Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 649183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:54:56+00:00 2026-05-13T21:54:56+00:00

i have an entity-model file (edmx) file which contains few tables and few stored

  • 0

i have an entity-model file (edmx) file which contains few tables and few stored procedures.

how can i call those stored procedures that are mapped to functions? i thought it should be trivial, and i do see the mapping in the edmx file, but i can’t figure how to use it in the code.

here is one mapping example:

       <Function Name="pa_crud_broker_ADD" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
          <Parameter Name="BrokerId" Type="int" Mode="InOut" />
          <Parameter Name="Name" Type="nvarchar" Mode="In" />
          <Parameter Name="Identifier" Type="nvarchar" Mode="In" />
        </Function>

          <FunctionImport Name="pa_crud_broker_ADD" ReturnType="Collection(Int32)">
            <Parameter Name="BrokerId" Mode="InOut" Type="Int32" />
            <Parameter Name="Name" Mode="In" Type="String" />
            <Parameter Name="Identifier" Mode="In" Type="String" /></FunctionImport>
<FunctionImportMapping FunctionImportName="pa_crud_broker_ADD" FunctionName="PAEntities.store.pa_crud_broker_ADD" />

i would appreciate any help.

Thanks.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:54:56+00:00Added an answer on May 13, 2026 at 9:54 pm

    I am a little rusty, however you should be able to call your function in one of two ways. If you are generating an ObjectContext from your model, then you should have a method on your object context that matches the name of your Function (in your case, pa_crud_broker_ADD). You should be able to call it like so:

    var objectContext = new MyObjectContext(...);
    var result = objectContext.pa_crud_broker_ADD(...);
    

    If you are not generating an ObjectContext from your model, then you should be able to use the following:

    var objectContext = new ObjectContext(...);
    var result = objectContext.ExecuteFunction<List<int>>("pa_crud_broker_ADD", ...);
    

    I am not entirely certain about the return result in the second case. I am not sure if EF v1 supports such a transformation or not. I know that EF v4 adds some considerable improvements in this area, so if EF v1 does not support it, I would look into EF v4.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a edmx file created using the entity entity framework model. Whenever I
I am working on asp.net application and I have generated entity model (edmx) from
I have an Entity Data Model that I have created, and its pulling in
I have an Entity Data Model-based app that uses SQL Server CE 3.5 as
In my business model I have Entity class (IPoint interface ) that has a
We have several SQL scripts which are generated from an Entity Model. They need
I use an Entity Framework (edmx file) for my model, and I'm using WCF
I have an entity model build using EF4.1 code first, which uses a WCF
I have a Entity Framework 5 Model First project, with the following tables: Extension
In my application I'm using Entity Framework 4.0 Model First. I have several tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.