ADO.NET Entity Framework Stored Procedures

.net ado.net entity-framework

Question

In the entity framework, I'm attempting to utilize a stored procedure. I first generated the model without the stored procedure. Then I proceeded to Update Model from Database, made my selection of the desired stored procedure, and inserted it using the function import. Now that the function is shown under Function Imports in the model browser, I can see it, but when I attempt to use it on the object context, I get an error stating that the "xxModel" does not include a definition for the "xxfunction". Anyone know what I may be doing incorrectly?

In the file pertaining to the proc, I don't find any issues.

The tags for the saved procs in the edmx file are listed below.

    <Function Name="p_DeleteDealFacts" Aggregate="false" BuiltIn="false"
        NiladicFunction="false" IsComposable="false"
        ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
        <Parameter Name="DealID" Type="int" Mode="In" />

    <FunctionImportMapping FunctionImportName="DeleteDealFacts"
          FunctionName="InterceptModel.Store.p_DeleteDealFacts" />
</EntityContainerMapping>
1
2
11/21/2010 8:51:16 PM

Popular Answer

If and only if you indicate that the return type should be an entity type, Visual Studio will construct the function code in the model's code-behind. Null and scalar return types are incompatible. I think it looks like a bug. Here is the whole narrative: Function Imports with a Non-Entity Return Type in an Entity Model

1
5/23/2017 12:01:12 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow