public IEnumerable <ComandaItemDto> ListarComandaItens(int vendaId)
 {
     return
         (from vendaItem in context.Set <VendaItem>()
          join produto in context.Set <Produto>()
          on vendaItem.ProdutoId equals produto.Id
          where vendaItem.VendaId == vendaId
          select new ComandaItemDto
     {
         VendaId = vendaItem.VendaId,
         VendaItemId = vendaItem.Id,
         Quantidade = vendaItem.Quantidade,
         ProdutoDesconto = vendaItem.Desconto,
         ProdutoDescricao = vendaItem.ProdutoDescricao,
         ProdutoId = vendaItem.ProdutoId,
         ProdutoPreco = vendaItem.Preco,
         ProdutoTipo = produto.Tipo,
         Brinde = vendaItem.Brinde,
         ProdutoCodigo = produto.Codigo
     });
 }
Example #2
0
 public RepositoryBase(BarDGContext context)
 {
     Db    = context;
     DbSet = Db.Set <TEntity>();
 }