本文整理汇总了C#中IQueryable.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# IQueryable.Contains方法的具体用法?C# IQueryable.Contains怎么用?C# IQueryable.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQueryable
的用法示例。
在下文中一共展示了IQueryable.Contains方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ItemGetByBuyer
public IQueryable<Item> ItemGetByBuyer(IQueryable<Item> items, User buyer)
{
return from ord in yikuData.Orders
where ord.UID == buyer.UID && items.Contains(ord.Item)
orderby ord.OrID
select ord.Item;
}
示例2: ClassGetByItems
public IQueryable<ClassM> ClassGetByItems(IQueryable<Item> items)
{
return (from cly in yikuData.T_Classify
where items.Contains(cly.Item)
orderby cly.T_Cl_ID
select cly.Class
).Distinct();
}
示例3: WithID
public static IQueryable<NewsItemSummary> WithID(this IQueryable<NewsItemSummary> qry, IQueryable<Guid> Ids)
{
return from newsItemSummary in qry
where Ids.Contains(newsItemSummary.ID)
select newsItemSummary;
}
示例4: WithID
public static IQueryable<Site> WithID(this IQueryable<Site> qry, IQueryable<Guid> Ids)
{
return from site in qry
where Ids.Contains(site.ID)
select site;
}
示例5: WithID
public static IQueryable<ListenTo.Shared.DO.Action> WithID(this IQueryable<ListenTo.Shared.DO.Action> qry, IQueryable<Guid> Ids)
{
return from action in qry
where Ids.Contains(action.ID)
select action;
}
示例6: WithID
public static IQueryable<Gig> WithID(this IQueryable<Gig> qry, IQueryable<Guid> Ids)
{
return from gig in qry
where Ids.Contains(gig.ID)
select gig;
}
示例7: GetList
/// <summary>
/// Gets the action list.
/// permission service used
/// </summary>
/// <param name="actionIdList">The action id list.</param>
/// <returns></returns>
public IQueryable<iPow.Infrastructure.Data.DataSys.Sys_MvcControllerAction> GetList(IQueryable<int> actionIdList)
{
var res = actionRepository.GetList(d => actionIdList.Contains(d.Id)).AsQueryable();
return res;
}
示例8: ItemGetByClass
public IQueryable<Item> ItemGetByClass(IQueryable<Item> items, ClassM classm)
{
return from cly in yikuData.T_Classify
where items.Contains(cly.Item) && cly.CID == classm.CID
orderby cly.IID
select cly.Item;
}
示例9: WithID
public static IQueryable<Artist> WithID(this IQueryable<Artist> qry, IQueryable<Guid> Ids)
{
return from artist in qry
where Ids.Contains(artist.ID)
select artist;
}
示例10: Get
public IQueryable<HistoryItem> Get(IQueryable<Task> tasks, Status status)
{
return _querySource
.Where(h => tasks.Contains(h.Belong)
&& h.Status == status);
}
示例11: WithID
public static IQueryable<ListenTo.Shared.DTO.ArtistSummary> WithID(this IQueryable<ListenTo.Shared.DTO.ArtistSummary> qry, IQueryable<Guid> Ids)
{
return from artist in qry
where Ids.Contains(artist.ID)
select artist;
}
示例12: UsersGetByItems
public IQueryable<User> UsersGetByItems(IQueryable<User> users, IQueryable<Item> items)
{
return from ord in yikuData.Orders
where items.Contains(ord.Item) && yikuData.Users.Contains(ord.User)
select ord.User;
}
示例13: GetOtherLocationsMatchingState
/// <summary>
/// Get All locations which match the passed collection's State, but do not match the ID.
/// </summary>
/// <param name="locations">A Collection of States.</param>
/// <returns>A Collection of States.</returns>
public IQueryable<Location> GetOtherLocationsMatchingState(IQueryable<Location> locations)
{
return db.Locations.Where(l =>
locations.Select(u => u.StateID).Contains(l.StateID)
&& !locations.Contains(l)
);
}
示例14: BindFamilies
private void BindFamilies( RockContext rockContext, IQueryable<Person> personQry, IQueryable<int> dataviewPersonIdQry )
{
var familyGroupType = GroupTypeCache.Read( Rock.SystemGuid.GroupType.GROUPTYPE_FAMILY.AsGuid() );
var personIds = personQry.Select( p => p.Id );
var groupMemberQry = new GroupMemberService( rockContext )
.Queryable().AsNoTracking()
.Where( m =>
m.Group.GroupTypeId == familyGroupType.Id &&
personIds.Contains( m.PersonId ) );
var familyIdQry = groupMemberQry.Select( m => m.GroupId ).Distinct();
_familyMembers = new GroupService( rockContext )
.Queryable().AsNoTracking()
.Where( g => familyIdQry.Contains( g.Id ) )
.Select( g => new
{
GroupId = g.Id,
People = g.Members
.Where( m => dataviewPersonIdQry.Contains( m.PersonId ) )
.OrderBy( m => m.GroupRole.Order )
.ThenBy( m => m.Person.BirthDate )
.Select( m => m.Person )
.Select( p => new PersonDirectoryItem
{
Id = p.Id,
RecordTypeValueId = p.RecordTypeValueId,
NickName = p.NickName,
LastName = p.LastName,
Email = p.Email,
BirthMonth = p.BirthMonth,
BirthDay = p.BirthDay,
BirthDate = p.BirthDate,
Gender = p.Gender,
PhotoId = p.PhotoId,
GraduationYear = p.GraduationYear
} )
.ToList()
} )
.ToDictionary( k => k.GroupId, v => v.People );
if ( _showAddress )
{
var homeLoc = DefinedValueCache.Read( Rock.SystemGuid.DefinedValue.GROUP_LOCATION_TYPE_HOME.AsGuid() );
if ( familyGroupType != null && homeLoc != null )
{
_addresses = new GroupService( rockContext )
.Queryable().AsNoTracking()
.Where( g => familyIdQry.Contains( g.Id ) )
.Select( g => new
{
g.Id,
HomeLocations = g.GroupLocations
.Where( gl =>
gl.GroupLocationTypeValueId.HasValue &&
gl.GroupLocationTypeValueId == homeLoc.Id )
.Select( gl => gl.Location )
.ToList()
} )
.ToDictionary( k => k.Id, v => v.HomeLocations );
}
}
if ( _phoneNumberCaptions.Any() )
{
var familyPersonIds = _familyMembers
.SelectMany( m => m.Value )
.Select( p => p.Id )
.Distinct()
.ToList();
LoadPhoneNumbers( rockContext, familyPersonIds );
}
var families = groupMemberQry.Select( m => new FamilyDirectoryItem
{
Id = m.GroupId,
Name = m.Group.Name
} )
.Distinct()
.Take( GetAttributeValue( "MaxResults" ).AsInteger() )
.ToList();
rptFamilies.DataSource = families;
rptFamilies.DataBind();
rptFamilies.Visible = true;
rptPeople.Visible = false;
}