public List <PromocionVentaViewModel> ObtenerPromocionesVigentesVenta(FiltroVentaViewModel filtro) { var promocionQuery = VigentesQuery(null); if (!string.IsNullOrWhiteSpace(filtro.MedioDePago)) { promocionQuery = promocionQuery.Where(p => p.MediosDePago.Contains(filtro.MedioDePago)); } if (!string.IsNullOrWhiteSpace(filtro.Banco)) { promocionQuery = promocionQuery.Where(p => p.Bancos.Contains(filtro.Banco)); } if (filtro.CategoriaProducto != null && filtro.CategoriaProducto.Count() > 0) { promocionQuery = promocionQuery.Where(p => filtro.CategoriaProducto.Where(cp => p.CategoriasProductos.Contains(cp)).Any()); } return(_mapper.Map <List <PromocionVentaViewModel> >(promocionQuery.ToList())); }
public ActionResult <IEnumerable <PromocionVentaViewModel> > GetVigenteVenta(FiltroVentaViewModel filtro) => _promocionesService.ObtenerPromocionesVigentesVenta(filtro);