How can I retrieve the ID during an insert in C# using CSLA? The stored procedure does an insert into the database table and then has a SELECT @Id (which is set with the SCOPE_IDENTITY()) after the insert.
This is the code to insert in C#:
using (var mgr = ContextManager<PersonDataContext>.GetManager("TestDB"))
{
var results = mgr.DataContext.up_StoredProcToInsert(
"David",
30,
);
}
try below example based on CRUD Operations using Stored Procedure in Entity Framework:
SP:
C# code: