Can anyone tell me an efficient way of returning this. I have:
var allPrices = site.Prices.AsQueryable();
I now want to query allPrices from current year onwards.
Thanks
Can anyone tell me an efficient way of returning this. I have:
var allPrices = site.Prices.AsQueryable();
I now want to query allPrices from current year onwards.
Thanks
var allPricesFiltered = allPrices.Where(p => p.Date.Year >= DateTime.Now.Year);
var currYear = DateTime.Now.Year;
var pricesAfterCurrYear = allPrices.Where(p => p.Date.Year >= currYear);