public async Task <ActionResult <IEnumerable <PublicApi.v1.DTO.ProductInOrder> > > GetInfoByOrderId(int id) { var productInOrder = (await _bll.ProductsInOrder.AllAsyncByShopAndOrderId(id, User.GetShopId())) .Select(e => ProductInOrderMapper.MapFromBLL(e)).ToList(); return(productInOrder); }
public async Task <ActionResult <PublicApi.v1.DTO.ProductInOrder> > GetProductInOrder(int id) { var productInOrder = await _bll.ProductsInOrder.GetAsyncByShopAndIdDTO(id, User.GetShopId()); if (productInOrder == null) { return(NotFound()); } return(ProductInOrderMapper.MapFromBLL(productInOrder)); }
public override async Task <List <DTO.DomainLikeDTO.ProductInOrder> > AllAsync() { return(await RepositoryDbSet .Include(p => p.Order).ThenInclude(m => m.Description).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.ProductName).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.Length).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.Weight).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.ManuFacturerItemCode).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.ShopCode).ThenInclude(t => t.Translations) .Select(e => ProductInOrderMapper.MapFromDomain(e)).ToListAsync()); }
public async Task <IActionResult> PutProductInOrder(int id, PublicApi.v1.DTO.ProductInOrder productInOrder) { if (!ModelState.IsValid || id != productInOrder.Id) { return(BadRequest()); } _bll.ProductsInOrder.Update(ProductInOrderMapper.MapFromExternal(productInOrder)); await _bll.SaveChangesAsync(); return(NoContent()); }
public override async Task <DTO.DomainLikeDTO.ProductInOrder> FindAsync(params object[] id) { var productInOrder = await RepositoryDbSet.FindAsync(id); return(ProductInOrderMapper.MapFromDomain(await RepositoryDbSet.Where(a => a.Id == productInOrder.Id) .Include(p => p.Order).ThenInclude(m => m.Description).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.ProductName).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.Length).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.Weight).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.ManuFacturerItemCode).ThenInclude(t => t.Translations) .Include(a => a.Product).ThenInclude(aa => aa.ShopCode).ThenInclude(t => t.Translations) .FirstOrDefaultAsync())); }
public async Task <DTO.ProductInOrder> GetAsyncByShopAndIdDTO(int id, int?shopId) { return(ProductInOrderMapper.MapFromDAL(await Uow.ProductsInOrder.GetAsyncByShopAndIdDTO(id, shopId))); }
public async Task <List <DTO.ProductInOrder> > AllAsyncByShopDTO(int?shopId) { return((await Uow.ProductsInOrder.AllAsyncByShopDTO(shopId)).Select(e => ProductInOrderMapper.MapFromDAL(e)) .ToList()); }
public async Task <List <DTO.DomainLikeDTO.ProductInOrder> > AllAsyncByOrderId(int orderId) { return((await Uow.ProductsInOrder.AllAsyncByOrderId(orderId)).Select(e => ProductInOrderMapper.MapFromDAL(e)).ToList()); }
public override async Task <ProductInOrder> FindAsync(params object[] id) { return(ProductInOrderMapper.MapFromDAL(await Uow.ProductsInOrder.FindAsync(id))); }
public override async Task <List <ProductInOrder> > AllAsync() { return((await Uow.ProductsInOrder.AllAsync()).Select(e => ProductInOrderMapper.MapFromDAL(e)).ToList()); }
/*public override async Task<IEnumerable<ProductInOrder>> AllAsync() * { * return await UOW.ProductsInOrder.AllAsync(); * } * * public override async Task<ProductInOrder> FindAsync(params object[] id) * { * return await UOW.ProductsInOrder.FindAsync(id); * } * * public async Task<IEnumerable<ProductInOrder>> AllAsyncByShop(int? shopId) * { * return await UOW.ProductsInOrder.AllAsyncByShop(shopId); * } * * public async Task<IEnumerable<ProductInOrderDTO>> AllAsyncByShopDTO(int? shopId) * { * return await UOW.ProductsInOrder.AllAsyncByShopDTO(shopId); * } * * public async Task<ProductInOrderDTO> GetAsyncByShopAndIdDTO(int id, int? shopId) * { * return await UOW.ProductsInOrder.GetAsyncByShopAndIdDTO(id, shopId); * }*/ public async Task <List <OrderReceived> > FindOrdersReceivedByOrderId(int orderId, int?shopId) { return((await Uow.ProductsInOrder.FindOrdersReceivedByOrderId(orderId, shopId)) .Select(e => ProductInOrderMapper.MapFromDAL(e)).ToList()); }