public ItemCardSizePriceService(IAjkaShopDbContext ajkaShopDbContext,
                                 IUnitOfWork unitOfWork,
                                 IItemCardSizePriceQueries itemCardSizePriceQueries)
 {
     _ajkaShopDbContext        = ajkaShopDbContext;
     _unitOfWork               = unitOfWork;
     _itemCardSizePriceQueries = itemCardSizePriceQueries;
 }
示例#2
0
        public async Task <IEnumerable <ItemCardDto> > GetItemCardsForSaleAsync(IAjkaShopDbContext ajkaShopDbContext, int categoryId, CancellationToken cancellationToken)
        {
            var itemCards = await ajkaShopDbContext.ItemCard.AsNoTracking()
                            .Where(x => x.CategoryId == categoryId && x.State == ItemCardEnums.ItemCardState.ForSale)
                            .ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false);

            return(_mapper.Map <IEnumerable <ItemCardDto> >(itemCards));
        }
示例#3
0
        public async Task <IEnumerable <UserDto> > GetUsersValidAsync(IAjkaShopDbContext ajkaShopDbContext, CancellationToken cancellationToken)
        {
            var userRecords = await ajkaShopDbContext.User.AsNoTracking()
                              .Where(x => x.IsValid)
                              .ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false);

            return(_mapper.Map <IEnumerable <UserDto> >(userRecords));
        }
示例#4
0
 public OrderController(IAjkaShopDbContext ajkaShopDbContext,
                        IOrderFacade orderFacade,
                        IOrderQueries orderQueries)
 {
     _ajkaShopDbContext = ajkaShopDbContext;
     _orderFacade       = orderFacade;
     _orderQueries      = orderQueries;
 }
示例#5
0
 public ItemCardImageController(IAjkaShopDbContext ajkaShopDbContext,
                                IItemCardImageService itemCardImageService,
                                IItemCardImageQueries itemCardImageQueries)
 {
     _ajkaShopDbContext    = ajkaShopDbContext;
     _itemCardImageService = itemCardImageService;
     _itemCardImageQueries = itemCardImageQueries;
 }
示例#6
0
 public InvoiceService(IAjkaShopDbContext ajkaShopDbContext,
                       IWebHostEnvironment environment,
                       IInvoiceQueries invoiceQueries)
 {
     _ajkaShopDbContext = ajkaShopDbContext;
     _environment       = environment;
     _invoiceQueries    = invoiceQueries;
 }
示例#7
0
        public async Task <IEnumerable <ItemCardDto> > GetItemCardsAsync(IAjkaShopDbContext ajkaShopDbContext, string keyWord, CancellationToken cancellationToken)
        {
            var itemCards = await ajkaShopDbContext.ItemCard.AsNoTracking()
                            .Where(x => (x.Headline.Contains(keyWord) || x.Description.Contains(keyWord)) && x.State == ItemCardEnums.ItemCardState.ForSale)
                            .ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false);

            return(_mapper.Map <IEnumerable <ItemCardDto> >(itemCards));
        }
示例#8
0
 public CategoryService(IAjkaShopDbContext ajkaShopDbContext,
                        IUnitOfWork unitOfWork,
                        ICategoryQueries categoryQueries)
 {
     _ajkaShopDbContext = ajkaShopDbContext;
     _unitOfWork        = unitOfWork;
     _categoryQueries   = categoryQueries;
 }
示例#9
0
        public async Task <IEnumerable <CategoryDto> > GetCategoriesValidAsync(IAjkaShopDbContext ajkaShopDbContext, CancellationToken cancellationToken)
        {
            var userRecord = await ajkaShopDbContext.Category.AsNoTracking()
                             .Where(x => x.IsValid)
                             .OrderBy(o => o.Description)
                             .ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false);

            return(_mapper.Map <IEnumerable <CategoryDto> >(userRecord));
        }
示例#10
0
 public ItemCardController(IEntityDtoFacade <ItemCardDto, int> facade,
                           IAjkaShopDbContext ajkaShopDbContext,
                           IItemCardService itemCardService,
                           IItemCardQueries itemCardQueries) : base(facade)
 {
     _ajkaShopDbContext = ajkaShopDbContext;
     _itemCardService   = itemCardService;
     _itemCardQueries   = itemCardQueries;
 }
示例#11
0
        public async Task <InvoiceDetailDto> GetInvoiceDetailAsync(IAjkaShopDbContext ajkaShopDbContext, int id, CancellationToken cancellationToken)
        {
            var invoice = await ajkaShopDbContext.Invoice.AsNoTracking()
                          .Where(x => x.Id == id)
                          .Include(i => i.InvoiceItems)
                          .FirstOrDefaultAsync(cancellationToken: cancellationToken).ConfigureAwait(false);

            return(_mapper.Map <InvoiceDetailDto>(invoice));
        }
示例#12
0
        public async Task <UserDto> GetUserAsync(IAjkaShopDbContext ajkaShopDbContext, string email, CancellationToken cancellationToken)
        {
            var userRecord = await ajkaShopDbContext.User.AsNoTracking()
                             .Where(x => x.Email == email)
                             .FirstOrDefaultAsync(cancellationToken: cancellationToken)
                             .ConfigureAwait(false);

            return(_mapper.Map <UserDto>(userRecord));
        }
示例#13
0
        public async Task <IEnumerable <OrderDto> > GetOrdersAsync(IAjkaShopDbContext ajkaShopDbContext, OrderState state, CancellationToken cancellationToken)
        {
            var itemCards = await ajkaShopDbContext.Order.AsNoTracking()
                            .Where(x => x.State == state)
                            .OrderBy(o => o.CreateDate)
                            .ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false);

            return(_mapper.Map <IEnumerable <OrderDto> >(itemCards));
        }
示例#14
0
 public UserController(IEntityDtoFacade <UserDto, int> facade,
                       IAjkaShopDbContext ajkaShopDbContext,
                       IUserQueries userQueries,
                       IOptions <AppSettings> appSettings) : base(facade)
 {
     _ajkaShopDbContext = ajkaShopDbContext;
     _userQueries       = userQueries;
     _appSettings       = appSettings.Value;
 }
示例#15
0
 public InvoiceController(IEntityDtoFacade <InvoiceDto, int> facade,
                          IAjkaShopDbContext ajkaShopDbContext,
                          IInvoiceService invoiceService,
                          IInvoiceQueries invoiceQueries) : base(facade)
 {
     _ajkaShopDbContext = ajkaShopDbContext;
     _invoiceService    = invoiceService;
     _invoiceQueries    = invoiceQueries;
 }
示例#16
0
 public CategoryController(IEntityDtoFacade <CategoryDto, int> facade,
                           IAjkaShopDbContext ajkaShopDbContext,
                           ICategoryService categoryService,
                           ICategoryQueries categoryQueries) : base(facade)
 {
     _ajkaShopDbContext = ajkaShopDbContext;
     _categoryService   = categoryService;
     _categoryQueries   = categoryQueries;
 }
示例#17
0
 public ItemCardImageService(IAjkaShopDbContext ajkaShopDbContext,
                             IUnitOfWork unitOfWork,
                             IWebHostEnvironment environment,
                             IFileProcessingService fileProcessingService,
                             IItemCardImageQueries itemCardImageQueries)
 {
     _ajkaShopDbContext     = ajkaShopDbContext;
     _unitOfWork            = unitOfWork;
     _environment           = environment;
     _fileProcessingService = fileProcessingService;
     _itemCardImageQueries  = itemCardImageQueries;
 }
示例#18
0
 public async Task <IEnumerable <ItemCardImage> > GetEntitiesAsync(IAjkaShopDbContext ajkaShopDbContext, int itemCardId, CancellationToken cancellationToken)
 {
     return(await ajkaShopDbContext.ItemCardImage.AsNoTracking()
            .Where(x => x.ItemCardId == itemCardId)
            .ToListAsync(cancellationToken).ConfigureAwait(false));
 }
示例#19
0
 public async Task <IDictionary <string, int> > GetCategoriesCommodityDictionaryAsync(IAjkaShopDbContext ajkaShopDbContext, CancellationToken cancellationToken)
 {
     return(await ajkaShopDbContext.Category.AsNoTracking()
            .Where(x => x.GroupIdentifier != null)
            .ToDictionaryAsync(key => key.GroupIdentifier, value => value.Id, cancellationToken)
            .ConfigureAwait(false));
 }
示例#20
0
 public async Task <bool> IsCategoryExistingAsync(IAjkaShopDbContext ajkaShopDbContext, string categoryName, CancellationToken cancellationToken)
 {
     return(await ajkaShopDbContext.Category.AsNoTracking()
            .AnyAsync(x => x.GroupIdentifier == categoryName, cancellationToken).ConfigureAwait(false));
 }
示例#21
0
        public async Task <IEnumerable <ItemCardSizePriceDto> > GetItemCardSizePricesAsync(IAjkaShopDbContext ajkaShopDbContext, int itemCardId, CancellationToken cancellationToken)
        {
            var itemCardImages = await ajkaShopDbContext.ItemCardSizePrice.AsNoTracking()
                                 .Where(x => x.ItemCardId == itemCardId)
                                 .OrderBy(o => o.Id)
                                 .ToListAsync(cancellationToken).ConfigureAwait(false);

            return(_mapper.Map <IEnumerable <ItemCardSizePriceDto> >(itemCardImages));
        }
示例#22
0
 public async Task <bool> IsItemCardAssignedAsync(IAjkaShopDbContext ajkaShopDbContext, int id, CancellationToken cancellationToken)
 {
     return(await ajkaShopDbContext.Category.AsNoTracking()
            .AnyAsync(x => x.Id == id && x.ItemCards.Any(), cancellationToken).ConfigureAwait(false));
 }
示例#23
0
 public async Task <ItemCard> GetEntityAsync(IAjkaShopDbContext ajkaShopDbContext, string commodityIdentifier, CancellationToken cancellationToken)
 {
     return(await ajkaShopDbContext.ItemCard.AsNoTracking()
            .Where(x => x.CommodityIdentifier == commodityIdentifier)
            .FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false));
 }
示例#24
0
        public async Task <IEnumerable <ItemCardDto> > GetItemCardsAdministratorAsync(IAjkaShopDbContext ajkaShopDbContext, int categoryId, CancellationToken cancellationToken)
        {
            var itemCards = await ajkaShopDbContext.ItemCard.AsNoTracking()
                            .Where(x => x.CategoryId == categoryId)
                            .OrderBy(o => o.State)
                            .ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false);

            return(_mapper.Map <IEnumerable <ItemCardDto> >(itemCards));
        }