Book “Johnson Glenn – Accessing Data with Microsoft .NET Framework 4 – 2011” contains example of custom function, and call of function:
gv.DataSource = (... select new { ... , ModelDefinedFunctions.Detail(..)});
But on CD in practice tests with that book:
var instructors = from p in context.People
where YearsSince((DateTime)p.HireDate) > 10
select p;
and explanation: You must refer to the custom function using the method name. The method name must not be qualified with the model name. The method requires a DateTime parameter and this must be included.
Don’t have VS now, what is the right way?
ModelDefinedFunctionsis the name of the class where the methodDetailis defined. The two approaches are identical. There is no qualifier for the model name.