When I use Entity Framework to insert a row, I get this error:
The member with identity 'AutoNumber' does not exist in the metadata collection.\r\nParameter name: identity
The problem is an insert trigger on the table.
Here's the table structure:
CustomerID | (identity, auto increment)
FirstName |
LastName |
Here's the trigger:
CREATE TRIGGER [dbo].[TR_Customer_INSERT]
ON [dbo].[Customer]
FOR INSERT
AS
SET NOCOUNT ON
SELECT @@IDENTITY AS AutoNumber
RETURN
Is it possible to use Entity Framework without deleting the trigger? Could I define 'AutoNumber' somehow? Why doesn't it just ignore the results of the trigger?
Update: I gave up and deleted the trigger.