I have the follow Linq query … which executes correctly:
from t in Tasks where LookupTaskStarted(t.TaskId) == true select new { t.TaskId, t.Number, Started = LookupTaskStarted(t.TaskId) }
Is there anyway to create this as a property on the Linq-To-Sql class? Or do I always have to reference it like this?
I don’t have the answer to your question, but I have a refactoring suggestion. Instead of calling LookupTaskStarted() twice, you can record the value with a
letclause:After writing that, I realized that if you are filtering by
started, you don’t need theStartedproperty because all of them will be true.