EntityFramework-Reverse-POCO-Code-First-Generator
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard
Unable to call scalar function
I am attempting to use a scalar function in a LINQ to entities query.
The tt file is generating an instance method and when I attempt to use it throws the "Don't call this directly. Use LINQ to call the scalar valued function as part of your query" exception. var a = from s in db.Users where s.LastName == "lastname" select new { email = s.Email, number = db.is4_fnScalarValue2(1) };
I changed the method to static and removed from the interface and it is working now.
var a = from s in db.Users where s.LastName == "lastname" select new { email = s.Email, number = ApplicationDbContext.is4_fnScalarValue2(1) };