private PedidoDetail Converter(PedidoEntity e) { var service = new PedidoItemService(new ContextMercadOn()); PedidoDetail d = new PedidoDetail(); d.Cliente = e.ClienteEntity.nome; d.dataPedido = e.dataPedido.ToShortDateString(); d.Mercado = e.MercadoEntity.nome; d.total += service.ConsultarPorFiltro(x => x.idPedido == e.idPedido).Sum(x => x.precoItem); d.pedidoid = e.idPedido; return(d); }
public PedidoService(ContextMercadOn context) : base(context) { pedidoItemService = new PedidoItemService(context); }