当前位置: 首页>>代码示例>>C#>>正文


C# IQueryable.Contains方法代码示例

本文整理汇总了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;
 }
开发者ID:solamiku,项目名称:Yiku,代码行数:7,代码来源:YikuDataRepository_Item.cs

示例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();
 }
开发者ID:solamiku,项目名称:Yiku,代码行数:8,代码来源:YikuDataRepository_ClassM.cs

示例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;
 }
开发者ID:listentorick,项目名称:ListenTo,代码行数:6,代码来源:NewsItemSummaryFilters.cs

示例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;
 }
开发者ID:listentorick,项目名称:ListenTo,代码行数:6,代码来源:SiteFilters.cs

示例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;
 }
开发者ID:listentorick,项目名称:ListenTo,代码行数:6,代码来源:ActionFilters.cs

示例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;
 }
开发者ID:listentorick,项目名称:ListenTo,代码行数:6,代码来源:GigFilters.cs

示例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;
 }
开发者ID:JPomichael,项目名称:IPOW,代码行数:11,代码来源:MvcActionService.cs

示例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;
 }
开发者ID:solamiku,项目名称:Yiku,代码行数:7,代码来源:YikuDataRepository_Item.cs

示例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;
 }
开发者ID:listentorick,项目名称:ListenTo,代码行数:6,代码来源:ArtistFilters.cs

示例10: Get

 public IQueryable<HistoryItem> Get(IQueryable<Task> tasks, Status status)
 {
     return _querySource
         .Where(h => tasks.Contains(h.Belong)
             && h.Status == status);
 }
开发者ID:feilang864,项目名称:task.zyfei.net,代码行数:6,代码来源:HistoryItemQuery.cs

示例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;
 }
开发者ID:listentorick,项目名称:ListenTo,代码行数:6,代码来源:ArtistSumaryFilters.cs

示例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;
 }
开发者ID:solamiku,项目名称:Yiku,代码行数:6,代码来源:YikuDataRepository_User.cs

示例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)
        );
 }
开发者ID:sennera,项目名称:tents-n-trails,代码行数:12,代码来源:LocationController.cs

示例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;
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:90,代码来源:PersonDirectory.ascx.cs


注:本文中的IQueryable.Contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。