Ejemplo n.º 1
0
 public CustomersController(ICustomerService customerService, ILogger <CustomersController> logger, IMemoryCache memoryCache, IOptions <PaginationOption> defaultPaginationOption)
 {
     this.customerService         = customerService;
     this.logger                  = logger;
     this.memoryCache             = memoryCache;
     this.defaultPaginationOption = defaultPaginationOption.Value;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得登录用户的分页数据
        /// </summary>
        /// <param name="po"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="ip"></param>
        /// <returns></returns>
        public virtual Page <LoginUser> RetrieveByPages(PaginationOption po, DateTime?startTime, DateTime?endTime, string?ip)
        {
            if (string.IsNullOrEmpty(po.Sort))
            {
                po.Sort = "LoginTime";
            }
            if (string.IsNullOrEmpty(po.Order))
            {
                po.Order = "desc";
            }
            var sql = new Sql("select * from LoginLogs");

            if (startTime.HasValue)
            {
                sql.Where("LoginTime >= @0", startTime.Value);
            }
            if (endTime.HasValue)
            {
                sql.Where("LoginTime < @0", endTime.Value.AddDays(1));
            }
            if (!string.IsNullOrEmpty(ip))
            {
                sql.Where("ip = @0", ip);
            }
            sql.OrderBy($"{po.Sort} {po.Order}");
            using var db = DbManager.Create();
            return(db.Page <LoginUser>(po.PageIndex, po.Limit, sql));
        }
Ejemplo n.º 3
0
        // public abstract IQueryable<T> Ordering(IQueryable<T> source, OrderingOption orderingOption);

        public async ValueTask <PagedResult <T> > Pagination(IQueryable <T> source, PaginationOption paginationOption = null)
        {
            if (paginationOption == null)
            {
                paginationOption = new PaginationOption();
            }

            int totalCount = source.Count();
            int lastPage   = (int)Math.Ceiling(totalCount / (double)paginationOption.PageSize);

            if (paginationOption.CurrentPage > lastPage)
            {
                paginationOption.CurrentPage = lastPage;
            }

            var getResult = source
                            .Skip((paginationOption.CurrentPage - 1) * paginationOption.PageSize)
                            .Take(paginationOption.PageSize)
                            .AsNoTracking()
                            .ToListAsync();

            return(new PagedResult <T>(
                       paginationOption.PageSize,
                       paginationOption.CurrentPage,
                       lastPage,
                       totalCount,
                       await getResult
                       ));
        }
Ejemplo n.º 4
0
 public DogService(IFileUtil fileUtil, IDogRepository dogRepository, IOptions <PaginationOption> paginationOption, IOptions <PathOption> pathOption)
 {
     this.fileUtil         = fileUtil;
     this.pathOption       = pathOption.Value;
     this.dogRepository    = dogRepository;
     this.paginationOption = paginationOption.Value;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 查询所有SQL日志信息
        /// </summary>
        /// <param name="po"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public virtual Page <DBLog> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime, string?userName)
        {
            if (string.IsNullOrEmpty(po.Sort))
            {
                po.Sort = "LogTime";
            }
            if (string.IsNullOrEmpty(po.Order))
            {
                po.Order = "desc";
            }
            var sql = new Sql("select * from DBLogs");

            if (startTime.HasValue)
            {
                sql.Where("LogTime >= @0", startTime.Value);
            }
            if (endTime.HasValue)
            {
                sql.Where("LogTime < @0", endTime.Value.AddDays(1).AddSeconds(-1));
            }
            if (startTime == null && endTime == null)
            {
                sql.Where("LogTime > @0", DateTime.Today.AddMonths(0 - DictHelper.RetrieveExceptionsLogPeriod()));
            }
            if (!string.IsNullOrEmpty(userName))
            {
                sql.Where("UserName = @0", userName);
            }
            sql.OrderBy($"{po.Sort} {po.Order}");

            using var db = DbManager.Create();
            return(db.Page <DBLog>(po.PageIndex, po.Limit, sql));
        }
Ejemplo n.º 6
0
 PaginationDefinition GetPaginationQuery(PaginationOption <T> paginationOption)
 {
     if (paginationOption == null || paginationOption.PageSize == 0)
     {
         return(new PaginationDefinition(null, null));
     }
     return(new PaginationDefinition(paginationOption.PageNo * paginationOption.PageSize, paginationOption.PageSize));
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 分页查询操作日志
        /// </summary>
        /// <param name="po"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="opType"></param>
        /// <returns></returns>
        public override Page <DataAccess.Log> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime, string?opType)
        {
            var filterBuilder = Builders <DataAccess.Log> .Filter;
            var filter        = filterBuilder.Empty;

            if (startTime.HasValue)
            {
                filter = filterBuilder.Gte("LogTime", startTime.Value);
            }
            if (endTime.HasValue)
            {
                filter = filterBuilder.Lt("LogTime", endTime.Value.AddDays(1).AddSeconds(-1));
            }
            if (startTime == null && endTime == null)
            {
                filter = filterBuilder.Gt("LogTime", DateTime.Today.AddMonths(0 - DictHelper.RetrieveAccessLogPeriod()));
            }
            if (!string.IsNullOrEmpty(opType))
            {
                filter = filterBuilder.Eq("CRUD", opType);
            }

            // sort
            var sortBuilder = Builders <DataAccess.Log> .Sort;
            var sort        = po.Order == "asc" ? sortBuilder.Ascending(t => t.LogTime) : sortBuilder.Descending(t => t.LogTime);

            switch (po.Sort)
            {
            case "CRUD":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.CRUD) : sortBuilder.Descending(t => t.CRUD);
                break;

            case "UserName":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.UserName) : sortBuilder.Descending(t => t.UserName);
                break;

            case "Ip":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.Ip) : sortBuilder.Descending(t => t.Ip);
                break;

            case "RequestUrl":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.RequestUrl) : sortBuilder.Descending(t => t.RequestUrl);
                break;
            }

            var logs = DbManager.Logs.Find(filter).Sort(sort).ToList();

            return(new Page <DataAccess.Log>()
            {
                Context = logs,
                CurrentPage = po.PageIndex,
                ItemsPerPage = po.Limit,
                TotalItems = logs.Count,
                TotalPages = (long)Math.Ceiling(logs.Count * 1.0 / po.Limit),
                Items = logs.Skip(po.Offset).Take(po.Limit).ToList()
            });
        }
Ejemplo n.º 8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="po"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public override Page <DataAccess.Exceptions> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime)
        {
            // filter
            var filterBuilder = Builders <DataAccess.Exceptions> .Filter;
            var filter        = filterBuilder.Empty;

            if (startTime.HasValue)
            {
                filter = filterBuilder.Gt("LogTime", startTime.Value);
            }
            if (endTime.HasValue)
            {
                filter = filterBuilder.Lt("LogTime", endTime.Value.AddDays(1).AddSeconds(-1));
            }
            if (startTime == null && endTime == null)
            {
                filter = filterBuilder.Gt("LogTime", DateTime.Today.AddMonths(0 - DictHelper.RetrieveExceptionsLogPeriod()));
            }

            // sort
            var sortBuilder = Builders <DataAccess.Exceptions> .Sort;
            SortDefinition <DataAccess.Exceptions> sort = null;

            switch (po.Sort)
            {
            case "LogTime":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.LogTime) : sortBuilder.Descending(t => t.LogTime);
                break;

            case "ErrorPage":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.ErrorPage) : sortBuilder.Descending(t => t.ErrorPage);
                break;

            case "UserId":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.UserId) : sortBuilder.Descending(t => t.UserId);
                break;

            case "UserIp":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.UserIp) : sortBuilder.Descending(t => t.UserIp);
                break;
            }

            var exceps = DbManager.Exceptions.Find(filter).Sort(sort).ToList();

            return(new Page <DataAccess.Exceptions>()
            {
                Context = exceps,
                CurrentPage = po.PageIndex,
                ItemsPerPage = po.Limit,
                TotalItems = exceps.Count,
                TotalPages = (long)Math.Ceiling(exceps.Count * 1.0 / po.Limit),
                Items = exceps.Skip(po.Offset).Take(po.Limit).ToList()
            });
        }
Ejemplo n.º 9
0
        public ValueTask <PagedResult <Lesson> > RetrieveLessons(
            SearchingOption searchingOption,
            OrderingOption orderingOption,
            PaginationOption paginationOption
            )
        {
            var lessons = RetrieveAll();

            lessons = Searching(lessons, searchingOption);
            lessons = Ordering(lessons, orderingOption);
            return(Pagination(lessons, paginationOption));
        }
Ejemplo n.º 10
0
        public ValueTask <PagedResult <Student> > RetrieveStudents(
            SearchingOption searchingOption,
            OrderingOption orderingOption,
            PaginationOption paginationOption
            )
        {
            var students = RetrieveAll();

            students = Searching(students, searchingOption);
            students = Ordering(students, orderingOption);
            return(Pagination(students, paginationOption));
        }
        public ValueTask <PagedResult <AttendanceSheet> > RetrieveAttendanceSheets(
            SearchingOption searchingOption,
            OrderingOption orderingOption,
            PaginationOption paginationOption
            )
        {
            var attendanceSheets = RetrieveAll();

            attendanceSheets = Searching(attendanceSheets, searchingOption);
            attendanceSheets = Ordering(attendanceSheets, orderingOption);
            return(Pagination(attendanceSheets, paginationOption));
        }
Ejemplo n.º 12
0
 public HistoryService(IOptions <PaginationOption> paginationOptions, UserManager <User> userManager, IGameRepository gameRepository, IPlayerRepository playerRepository, IBotRepository botRepository, IPlayerStepRepository playerStepRepository,
                       IBotStepRepository botStepRepository, IPlayerInGameRepository playerInGameRepository, IBotInGameRepository botInGameRepository)
 {
     _userManager            = userManager;
     _gameRepository         = gameRepository;
     _playerRepository       = playerRepository;
     _botRepository          = botRepository;
     _playerStepRepository   = playerStepRepository;
     _botStepRepository      = botStepRepository;
     _botInGameRepository    = botInGameRepository;
     _playerInGameRepository = playerInGameRepository;
     _paginationOptions      = paginationOptions.Value;
 }
Ejemplo n.º 13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="po"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="ip"></param>
        /// <returns></returns>
        public override Page <DataAccess.LoginUser> RetrieveByPages(PaginationOption po, DateTime?startTime, DateTime?endTime, string?ip)
        {
            var logs = RetrieveAll(startTime, endTime, ip);

            return(new Page <DataAccess.LoginUser>()
            {
                Context = logs,
                CurrentPage = po.PageIndex,
                ItemsPerPage = po.Limit,
                TotalItems = logs.Count(),
                TotalPages = (long)Math.Ceiling(logs.Count() * 1.0 / po.Limit),
                Items = logs.Skip(po.Offset).Take(po.Limit).ToList()
            });
        }
Ejemplo n.º 14
0
        public ValueTask <PagedResult <Lesson> > RetrieveEnrolledLessons(
            Guid studentId,
            SearchingOption searchingOption,
            OrderingOption orderingOption,
            PaginationOption paginationOption
            )
        {
            var enrolments = _context.Set <Enrolment>().AsQueryable();

            var enrolledLessons = enrolments
                                  .Include(enrolment => enrolment.Lesson)
                                  .Where(enrolment => enrolment.StudentId == studentId)
                                  .Select(enrolment => enrolment.Lesson);

            enrolledLessons = Searching(enrolledLessons, searchingOption);
            enrolledLessons = Ordering(enrolledLessons, orderingOption);
            return(Pagination(enrolledLessons, paginationOption));
        }
Ejemplo n.º 15
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="po"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="ip"></param>
        /// <returns></returns>
        public virtual Page <LoginUser> RetrieveByPages(PaginationOption po, DateTime?startTime, DateTime?endTime, string ip)
        {
            var sql = new Sql("select UserName, LoginTime, Ip, Browser, OS, City, Result from LoginLogs");

            if (startTime.HasValue)
            {
                sql.Where("LoginTime >= @0", startTime.Value);
            }
            if (endTime.HasValue)
            {
                sql.Where("LoginTime < @0", endTime.Value.AddDays(1));
            }
            if (!string.IsNullOrEmpty(ip))
            {
                sql.Where("ip = @0", ip);
            }
            sql.OrderBy($"{po.Sort} {po.Order}");
            return(DbManager.Create().Page <LoginUser>(po.PageIndex, po.Limit, sql));
        }
Ejemplo n.º 16
0
        [ServiceFilter(typeof(PaginationOptionFilter))] // pagination filter
        public ActionResult <PaginationDto <CustomerDto> > GetAll([FromQuery] PaginationOption paginationQueryParams, [FromQuery] bool withCache = true)
        {
            PaginationDto <CustomerDto> customerList = null;

            if (paginationQueryParams.Page == defaultPaginationOption.Page && paginationQueryParams.Size == defaultPaginationOption.Size && withCache)
            {
                // using lambda function setting the cache
                customerList = this.memoryCache.GetOrCreate(CacheHelper.CustomerFirstPage, entry =>
                {
                    entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(10);
                    return(this.customerService.GetCustomers(paginationQueryParams.Page, paginationQueryParams.Size));
                });
            }
            else
            {
                customerList = this.customerService.GetCustomers(paginationQueryParams.Page, paginationQueryParams.Size);
            }

            return(Ok(customerList));
        }
Ejemplo n.º 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="po"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public virtual Page <Exceptions> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime)
        {
            var sql = new Sql("select * from Exceptions");

            if (startTime.HasValue)
            {
                sql.Append("where LogTime > @0", startTime.Value);
            }
            if (endTime.HasValue)
            {
                sql.Append("where LogTime < @0", endTime.Value.AddDays(1).AddSeconds(-1));
            }
            if (startTime == null && endTime == null)
            {
                sql.Append("where LogTime > @0", DateTime.Today.AddMonths(0 - DictHelper.RetrieveExceptionsLogPeriod()));
            }
            sql.Append($"order by {po.Sort} {po.Order}");

            return(DbManager.Create().Page <Exceptions>(po.PageIndex, po.Limit, sql));
        }
Ejemplo n.º 18
0
 public async Task <IActionResult> GetLessons(
     [FromQuery] SearchingOption searchingOption,
     [FromQuery] OrderingOption orderingOption,
     [FromQuery] PaginationOption paginationOption
     )
 {
     try
     {
         var lessons = _uow.LessonRepository.RetrieveLessons(
             searchingOption,
             orderingOption,
             paginationOption
             );
         return(Ok(_mapper.Map <PagedLessonDTO>(await lessons)));
     }
     catch (Exception e)
     {
         _logger.LogError($"Error in action `GetLessons()`. {e.Message}");
         return(StatusCode(StatusCodes.Status500InternalServerError));
     }
 }
Ejemplo n.º 19
0
 public async Task <IActionResult> GetEnrolledStudents(
     [FromRoute] Guid lessonId,
     [FromQuery] SearchingOption searchingOption,
     [FromQuery] OrderingOption orderingOption,
     [FromQuery] PaginationOption paginationOption
     )
 {
     try
     {
         var enrolledStudents = _uow.StudentRepository.RetrieveEnrolledStudents(
             lessonId,
             searchingOption,
             orderingOption,
             paginationOption
             );
         return(Ok(_mapper.Map <PagedStudentDTO>(await enrolledStudents)));
     }
     catch (Exception e)
     {
         _logger.LogError($"Error in action `GetEnrolledStudents()`. {e.Message}");
         return(StatusCode(StatusCodes.Status500InternalServerError));
     }
 }
Ejemplo n.º 20
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="po"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="ip"></param>
        /// <returns></returns>
        public virtual Page <Trace> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime, string ip)
        {
            var sql = new Sql("select UserName, LogTime, IP, Browser, OS, City, RequestUrl from Traces");

            if (startTime.HasValue)
            {
                sql.Where("LogTime > @0", startTime.Value);
            }
            if (endTime.HasValue)
            {
                sql.Where("LogTime < @0", endTime.Value.AddDays(1).AddSeconds(-1));
            }
            if (startTime == null && endTime == null)
            {
                sql.Where("LogTime > @0", DateTime.Today.AddMonths(0 - DictHelper.RetrieveAccessLogPeriod()));
            }
            if (!string.IsNullOrEmpty(ip))
            {
                sql.Where("IP = @0", ip);
            }
            sql.OrderBy($"{po.Sort} {po.Order}");

            return(DbManager.Create().Page <Trace>(po.PageIndex, po.Limit, sql));
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 查询所有操作日志信息
        /// </summary>
        /// <param name="po"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="opType"></param>
        /// <returns></returns>
        public virtual new Page <Log> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime, string opType)
        {
            var sql = new Sql("select * from Logs");

            if (startTime.HasValue)
            {
                sql.Where("LogTime >= @0", startTime.Value);
            }
            if (endTime.HasValue)
            {
                sql.Where("LogTime < @0", endTime.Value.AddDays(1).AddSeconds(-1));
            }
            if (startTime == null && endTime == null)
            {
                sql.Where("LogTime > @0", DateTime.Today.AddMonths(0 - DictHelper.RetrieveExceptionsLogPeriod()));
            }
            if (!string.IsNullOrEmpty(opType))
            {
                sql.Where("CRUD = @0", opType);
            }
            sql.OrderBy($"{po.Sort} {po.Order}");

            return(DbManager.Create().Page <Log>(po.PageIndex, po.Limit, sql));
        }
Ejemplo n.º 22
0
 public PostService(IUnitOfWork unitOfWork, IOptions <PaginationOption> options)
 {
     _unitOfWork = unitOfWork;
     _pagination = options.Value;
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 查询所有SQL日志信息
 /// </summary>
 /// <param name="op"></param>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static Page <DBLog> RetrieveDBLogs(PaginationOption op, DateTime?startTime, DateTime?endTime, string?userName) => DbContextManager.Create <DBLog>()?.RetrievePages(op, startTime, endTime, userName) ?? new Page <DBLog>()
 {
     Items = new List <DBLog>()
 };
Ejemplo n.º 24
0
 /// <summary>
 /// 查询指定页码登录日志
 /// </summary>
 /// <param name="po"></param>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <param name="ip"></param>
 public static Page <LoginUser> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime, string ip) => DbContextManager.Create <LoginUser>().RetrieveByPages(po, startTime, endTime, ip);
Ejemplo n.º 25
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="po"></param>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <returns></returns>
 public static Page <Exceptions> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime) => DbContextManager.Create <Exceptions>().RetrievePages(po, startTime, endTime);
Ejemplo n.º 26
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override Page <DataAccess.Trace> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime, string ip)
        {
            // filter
            var filterBuilder = Builders <DataAccess.Trace> .Filter;
            var filter        = filterBuilder.Empty;

            if (startTime.HasValue)
            {
                filter = filterBuilder.Gt("LogTime", startTime.Value);
            }
            if (endTime.HasValue)
            {
                filter = filterBuilder.Lt("LogTime", endTime.Value.AddDays(1).AddSeconds(-1));
            }
            if (!string.IsNullOrEmpty(ip))
            {
                filter = filterBuilder.Eq("Ip", ip);
            }
            if (startTime == null && endTime == null)
            {
                filter = filterBuilder.Gt("LogTime", DateTime.Today.AddMonths(0 - DictHelper.RetrieveAccessLogPeriod()));
            }

            // sort
            var sortBuilder = Builders <DataAccess.Trace> .Sort;
            SortDefinition <DataAccess.Trace> sort = null;

            switch (po.Sort)
            {
            case "LogTime":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.LogTime) : sortBuilder.Descending(t => t.LogTime);
                break;

            case "IP":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.Ip) : sortBuilder.Descending(t => t.Ip);
                break;

            case "UserName":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.UserName) : sortBuilder.Descending(t => t.UserName);
                break;

            case "City":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.City) : sortBuilder.Descending(t => t.City);
                break;

            case "Browser":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.Browser) : sortBuilder.Descending(t => t.Browser);
                break;

            case "OS":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.OS) : sortBuilder.Descending(t => t.OS);
                break;

            case "RequestUrl":
                sort = po.Order == "asc" ? sortBuilder.Ascending(t => t.RequestUrl) : sortBuilder.Descending(t => t.RequestUrl);
                break;
            }

            var traces = DbManager.Traces.Find(filter).Sort(sort).ToList();

            return(new Page <DataAccess.Trace>()
            {
                Context = traces,
                CurrentPage = po.PageIndex,
                ItemsPerPage = po.Limit,
                TotalItems = traces.Count,
                TotalPages = (long)Math.Ceiling(traces.Count * 1.0 / po.Limit),
                Items = traces.Skip(po.Offset).Take(po.Limit).ToList()
            });
        }
Ejemplo n.º 27
0
 /// <summary>
 /// 查询指定页码登录日志
 /// </summary>
 /// <param name="po"></param>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <param name="ip"></param>
 public static Page <LoginUser> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime, string?ip) => DbContextManager.Create <LoginUser>()?.RetrieveByPages(po, startTime, endTime, ip) ?? new Page <LoginUser>()
 {
     Items = new List <LoginUser>()
 };
Ejemplo n.º 28
0
 public ProductRepository(IDbConnectionFactory dbConnectionFactory, IOptions <PaginationOption> options) : base(dbConnectionFactory)
 {
     this._paginationOption = options.Value;
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PropertyService" /> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="paginationOption">The pagination option.</param>
 public PropertyService(IPropertyRepository repository, IOptions <PaginationOption> paginationOption)
 {
     _repository       = repository;
     _paginationOption = paginationOption.Value;
 }
 public PaginationOptionFilter(IOptions <PaginationOption> option)
 {
     this.defaultPaginationOption = option.Value;
 }