views:

27

answers:

1

Suppose I have a table like: Person(ID, Name, DOB, ...) I use EF to create model with VS2010. Then I want to use SP for CRUD. say my SP for insert like:

Create PROCEDURE [dbo].[Person_Add] 
(@DOB datetime, @NAME varchar(10)= null,@PersonType as int)
AS
    Begin
    ...
    End

Param @PersonType is someting I want to use in SP for some extra business logic, but it is not part of the table and model.

Then I use design surface for SP mapping. When map above SP for Insert function, edmx will ask me to map the param @PersonType, but there is no way to map it.

How to resolve this problem?

A: 

Try the following steps:
1. Import the stored procedure into the model.
Edit the model in XML Editor:
2. Remove the redundant parameter.
3. Add CommandText to this procedure in which you can execute the procedure itself.

Devart