コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pageIndex">0-based page index</param>
        /// <param name="pageSize"></param>
        /// <param name="descending"></param>
        /// <returns></returns>
        public virtual async Task <TotalResult <List <SubscriberCategorySettingsLong> > > Find(int pageIndex, int pageSize, bool descending)
        {
            RepositoryResult <SubscriberCategorySettingsLong> response = null;

            using (Repository repository = new Repository(_dbContextFactory.GetDbContext()))
            {
                response = await repository
                           .FindPageAsync <SubscriberCategorySettingsLong, long>(pageIndex, pageSize, descending
                                                                                 , x => true
                                                                                 , x => x.SubscriberCategorySettingsId, true)
                           .ConfigureAwait(false);
            }

            return(response.ToTotalResult());
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="subscriberIds"></param>
        /// <param name="pageIndex">0-based page index</param>
        /// <param name="pageSize"></param>
        /// <param name="descending"></param>
        /// <returns></returns>
        public virtual async Task <TotalResult <List <StoredNotification <long> > > > Select(List <long> subscriberIds
                                                                                             , int pageIndex, int pageSize, bool descending)
        {
            RepositoryResult <StoredNotificationLong> response = null;

            using (Repository repository = new Repository(_dbContextFactory.GetDbContext()))
            {
                response = await repository
                           .FindPageAsync <StoredNotificationLong, DateTime>(pageIndex, pageSize, descending
                                                                             , x => subscriberIds.Contains(x.SubscriberId)
                                                                             , x => x.CreateDateUtc, true)
                           .ConfigureAwait(false);
            }

            return(response.ToTotalResult <StoredNotificationLong, StoredNotification <long> >());
        }