views:

39

answers:

0

Hi I'm trying the entity framework and in my model i have a customer, customer_address and address tables. I've created stored procedures for crud operations for each table. Mapping the sprocs for customer and address went easy but mapping update sproc for customer_address gives me error. I'm confused how to implement this properly.

Here's my update sproc:

CREATE PROCEDURE "db_owner"."Customer_Address_Update"
(
 @CustomerID int,
 @originalCustomerID int,
 @AddressID int,
 @originalAddressID int,
 @AddressTypID smallint,
 @GueltigAb smalldatetime,
 @GueltigBis smalldatetime
)
AS
BEGIN
 UPDATE "db_owner"."Customer_Address"
 SET
   "CustomerID" = @CustomerID,
   "AddressID" = @AddressID,
   "AddressTypID" = @AddressTypID,
   "GueltigAb" = @GueltigAb,
   "GueltigBis" = @GueltigBis
 WHERE
   "CustomerID" = @originalCustomerID AND
   "AddressID" = @originalAddressID
END

To what property should i map originalCustomerID and originalAddressID? Which propery should use original value be set?