c# - EF 6.1 Scalar-Valued Functions Database First -
my application c# mvc5, using ef 6.1. imported tables , functions using database first. can see function in model (emdx) browser listed under dalmodel.store / stored procedures / functions (grayed out).
i trying utilize function using following:
using (var ctx = new dalentities()) { int? result = ctx.fn_totalclient(memberrepository.allowedcid, fromdate, todate); homecoming (result != null ? result.value : 0); }
i can't resolve fn_totalclient
would appreciate suggestions.
apparently not utilize scalar-valued function straight model; found solution in blog http://programmaticponderings.wordpress.com/2012/11/22/first-impressions-of-database-first-development-with-entity-framework-5-in-visual-studio-2012/.
however, used different approach redeveloping function table-valued function, used firstordefault() result value.
hope help facing same issue.
c# asp.net-mvc entity-framework sql-function
No comments:
Post a Comment