public ItemCardSizePriceService(IAjkaShopDbContext ajkaShopDbContext, IUnitOfWork unitOfWork, IItemCardSizePriceQueries itemCardSizePriceQueries) { _ajkaShopDbContext = ajkaShopDbContext; _unitOfWork = unitOfWork; _itemCardSizePriceQueries = itemCardSizePriceQueries; }
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)); }
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)); }
public OrderController(IAjkaShopDbContext ajkaShopDbContext, IOrderFacade orderFacade, IOrderQueries orderQueries) { _ajkaShopDbContext = ajkaShopDbContext; _orderFacade = orderFacade; _orderQueries = orderQueries; }
public ItemCardImageController(IAjkaShopDbContext ajkaShopDbContext, IItemCardImageService itemCardImageService, IItemCardImageQueries itemCardImageQueries) { _ajkaShopDbContext = ajkaShopDbContext; _itemCardImageService = itemCardImageService; _itemCardImageQueries = itemCardImageQueries; }
public InvoiceService(IAjkaShopDbContext ajkaShopDbContext, IWebHostEnvironment environment, IInvoiceQueries invoiceQueries) { _ajkaShopDbContext = ajkaShopDbContext; _environment = environment; _invoiceQueries = invoiceQueries; }
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)); }
public CategoryService(IAjkaShopDbContext ajkaShopDbContext, IUnitOfWork unitOfWork, ICategoryQueries categoryQueries) { _ajkaShopDbContext = ajkaShopDbContext; _unitOfWork = unitOfWork; _categoryQueries = categoryQueries; }
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)); }
public ItemCardController(IEntityDtoFacade <ItemCardDto, int> facade, IAjkaShopDbContext ajkaShopDbContext, IItemCardService itemCardService, IItemCardQueries itemCardQueries) : base(facade) { _ajkaShopDbContext = ajkaShopDbContext; _itemCardService = itemCardService; _itemCardQueries = itemCardQueries; }
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)); }
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)); }
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)); }
public UserController(IEntityDtoFacade <UserDto, int> facade, IAjkaShopDbContext ajkaShopDbContext, IUserQueries userQueries, IOptions <AppSettings> appSettings) : base(facade) { _ajkaShopDbContext = ajkaShopDbContext; _userQueries = userQueries; _appSettings = appSettings.Value; }
public InvoiceController(IEntityDtoFacade <InvoiceDto, int> facade, IAjkaShopDbContext ajkaShopDbContext, IInvoiceService invoiceService, IInvoiceQueries invoiceQueries) : base(facade) { _ajkaShopDbContext = ajkaShopDbContext; _invoiceService = invoiceService; _invoiceQueries = invoiceQueries; }
public CategoryController(IEntityDtoFacade <CategoryDto, int> facade, IAjkaShopDbContext ajkaShopDbContext, ICategoryService categoryService, ICategoryQueries categoryQueries) : base(facade) { _ajkaShopDbContext = ajkaShopDbContext; _categoryService = categoryService; _categoryQueries = categoryQueries; }
public ItemCardImageService(IAjkaShopDbContext ajkaShopDbContext, IUnitOfWork unitOfWork, IWebHostEnvironment environment, IFileProcessingService fileProcessingService, IItemCardImageQueries itemCardImageQueries) { _ajkaShopDbContext = ajkaShopDbContext; _unitOfWork = unitOfWork; _environment = environment; _fileProcessingService = fileProcessingService; _itemCardImageQueries = itemCardImageQueries; }
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)); }
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)); }
public async Task <bool> IsCategoryExistingAsync(IAjkaShopDbContext ajkaShopDbContext, string categoryName, CancellationToken cancellationToken) { return(await ajkaShopDbContext.Category.AsNoTracking() .AnyAsync(x => x.GroupIdentifier == categoryName, cancellationToken).ConfigureAwait(false)); }
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)); }
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)); }
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)); }
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)); }