public ActionResult <StylesPopularClearanceDTO> GetStylesPolularClearance() { var result = new StylesPopularClearanceDTO() { Polulars = _styleRepo.GetPopulars(), Clearances = _styleRepo.GetClearances() }; return(Ok(result)); }
public StylesPopularClearanceDTO GetStylesHomePage() { var polularIds = new List <int> { 9, 17, 24 }; var clearanceIds = new List <int> { 3, 8, 22 }; var styles = _DbContext.VwStyles.Where(vwStyle => clearanceIds.Contains(vwStyle.StyleId) || polularIds.Contains(vwStyle.StyleId)) .ProjectTo <StyleForListDTO>(_mapperProvider); var result = new StylesPopularClearanceDTO { Polulars = styles.Where(style => style.PriceCurrent == style.PriceRegular), Clearances = styles.Where(style => style.PriceCurrent < style.PriceRegular) }; return(result); }