c# - Call stored procedure in a Linq-to-Entities query -


i using ef 6 & visual studio 13 free community.

i using database-first approach in current project.

i created sql server db project , added project work ef

i created tables & stored procedures. after added db project created class procedure_name_result , need use linq queries in project don't know how call in query, or if recognize can't see in uploaded db

edit both answers able know how call in linq query

var query = x y              select new {                          elemnt,                           var_inside_query = db.procedure_name(@params)                         }; 

i use northwind database sample project.

using system; using system.collections.generic; using system.linq;  namespace ef_sp {     class program     {         static void main(string[] args)         {             using (var context = new northwindentities())             {                 var results = context.getsalesbycategory("seafood", "1998");                  foreach (var result in results)                     console.writeline("{0} {1}", result.productname, result.totalpurchase);             }              console.writeline("press key. . .");             console.readkey(true);         }     } } 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -