decimal sum = _myDB.Products
.Where(p => p.Start >= mystartDate && p.End <= myenddate)
.Sum(p => p.Price)
Sorry my syntax. But hopefully you have an idea.
EDIT: Fixed after Reid's suggestion.
Old code (incorrect)
decimal sum = _myDB.Products
.Sum(p => p.Price)
.Where(p => p.Start >= mystartDate && p.End <= myenddate)
source
share