You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
};
The text was updated successfully, but these errors were encountered:
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)
};
The text was updated successfully, but these errors were encountered: