I'm searching for the formula functionality in NHibernate with EF Code first.
Say that I have an Order with OrderLines, on the order I have my TotalAmount which could look like this
public decimal OrderTotal { return orderLines.Sum(x => x.Price); }
But I want this property to be searchable in Entity Framework so I want to do some sql code that will do this but in Sql. The result from the sql will not be set or read just be used in the search, in the memory the .net code will be used.
How can I accomplish this?