public PurchaseService(IMapper mapper, SFDbContext dbContext, ICustomerService customerService, IEmailSenderService emailSenderService) { _mapper = mapper; _DBContext = dbContext; _customerService = customerService; _emailSenderService = emailSenderService; }
public static async Task <PagedResultDTO <TDTO> > GetPage <TEntity, TDTO>(this SFDbContext dbContext, IMapper mapper, IQueryable <TEntity> query, int page, int pageSize) where TEntity : class where TDTO : class { if (page < 1) { throw new BadArgumentException("Page cannot be less than 1."); } if (pageSize < 1 || pageSize > 50) { throw new BadArgumentException("Page can contain from 1 to 50 objects."); } var countOfSkips = (page - 1) * pageSize; var entities = await query .AsNoTracking() .Skip(countOfSkips) .Take(pageSize) .ToListAsync(); var DTOs = mapper.Map <List <TDTO> >(entities); var pagedResultDTO = new PagedResultDTO <TDTO> { Data = DTOs, Page = page, PageSize = pageSize, TotalCount = query.Count() }; return(pagedResultDTO); }
public FestivalService(IMapper mapper, SFDbContext dbContext) { _mapper = mapper; _DBContext = dbContext; }
public StageService(IMapper mapper, SFDbContext dbContext) { _mapper = mapper; _DBContext = dbContext; }
public AdminService(IMapper mapper, IOptions <AppSettings> appSettings, SFDbContext dbContext) { _mapper = mapper; _appSettings = appSettings.Value; _DBContext = dbContext; }
public StatisticService(SFDbContext dbContext) { _DBContext = dbContext; }
public CustomerService(IMapper mapper, SFDbContext dbContext) { _mapper = mapper; _DBContext = dbContext; }
public TicketService(IMapper mapper, SFDbContext dbContext) { _mapper = mapper; _DBContext = dbContext; }
public virtual void OnDeleting(SFDbContext context) { }
public PerformanceService(IMapper mapper, SFDbContext dbContext) { _mapper = mapper; _DBContext = dbContext; }
public PartnerService(IMapper mapper, SFDbContext dbContext) { _mapper = mapper; _DBContext = dbContext; }