Exemplo n.º 1
0
 public override async Task <List <DTO.DomainLikeDTO.ProductSold> > AllAsync()
 {
     return(await RepositoryDbSet
            .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)
            .Include(p => p.Sale).ThenInclude(aa => aa.Description).ThenInclude(t => t.Translations)
            .Select(e => ProductSoldMapper.MapFromDomain(e)).ToListAsync());
 }
Exemplo n.º 2
0
        public override async Task <DTO.DomainLikeDTO.ProductSold> FindAsync(params object[] id)
        {
            var productSold = await RepositoryDbSet.FindAsync(id);

            return(ProductSoldMapper.MapFromDomain(await RepositoryDbSet.Where(a => a.Id == productSold.Id)
                                                   .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)
                                                   .Include(p => p.Sale).ThenInclude(aa => aa.Description).ThenInclude(t => t.Translations)
                                                   .FirstOrDefaultAsync()));
        }