How can we improve Entity Framework Core?

Stored procedure mapping in EF Core

EF6 supports mapping CUD operation to stored procedures in both Code First and EDMX based development.

EF Core does not have this functionality yet.

204 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Richard Deeming shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    10 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • David McClelland commented  ·   ·  Flag as inappropriate

        Code-First support for function imports (for reads) is the thing we are waiting for to be ready to move to EF from Linq to SQL :-)

      • Mike commented  ·   ·  Flag as inappropriate

        Reverse Engineer Code First - Would like to be able to generate the stored procedure wrappers.

      • Georgel commented  ·   ·  Flag as inappropriate

        In my company DBA don't authorize the SQL query for performance reason, only stored procedure can be used. Actually Entity Framework can use Insert, Delete, Update SP but can't be mapped to a default Get SP...

      • Mike Bishop commented  ·   ·  Flag as inappropriate

        Depends on what you mean be "support". You can still call stored procedures via context.Database.SqlQuery and context.Database.ExecuteSqlCommand

      • Robert Slaney commented  ·   ·  Flag as inappropriate

        This is stopping us migrate from Linq-to-Sql
        Also, map defaults on stored procedures parameters to optional parameters when code generating for .NET 4.0

      • Marcel Veldhuizen commented  ·   ·  Flag as inappropriate

        Very similar: support for User Defined Functions (UDF) while you're at it :)
        I really miss this feature of the model first approach.

      • Giddem commented  ·   ·  Flag as inappropriate

        Please please I really need stored procedure support in code first asap

      • Peter S commented  ·   ·  Flag as inappropriate

        I like all Entity Framework data access to automatically create and map to store procedure instead of calling sp_executesql with parameterized query.
        Advantages are:
        • All database code in one place!!!!!
        • Enables check by ”SQL Upgrade advisor”
        • System view for dependency checks
        • Using visual studio for static code analysis
        • Enables DBAs to see which questions are run
        • Enables DBAs to customize T-SQL, inde
        • Only need to grant excite stored procedure rights indeed of base table access
        • The use of stored procedure cache
        • May be even version control of the sps with database projects and TFS

      Feedback and Knowledge Base