Asp.net EntityDataSource中e.ReturnValue的等效项
我正在ASP.NET应用程序中使用EntityDataSource和DetailsView。我想在插入记录后获取标识列值。ObjectDataSource具有e.ReturnValue属性,我想知道它在EntityDataSource中的等价物?您可以订阅Asp.net EntityDataSource中e.ReturnValue的等效项,asp.net,objectdatasource,entitydatasource,Asp.net,Objectdatasource,Entitydatasource,我正在ASP.NET应用程序中使用EntityDataSource和DetailsView。我想在插入记录后获取标识列值。ObjectDataSource具有e.ReturnValue属性,我想知道它在EntityDataSource中的等价物?您可以订阅插入的事件,它是一个事件处理程序 EntityDataSourceChangedEventArgs实例有一个实体属性,表示新插入的实体 void EntityDataSource1_Inserted(object sender, EntityD
插入的
事件,它是一个事件处理程序
EntityDataSourceChangedEventArgs
实例有一个实体属性,表示新插入的实体
void EntityDataSource1_Inserted(object sender, EntityDataSourceChangedEventArgs e) {
YourEntityType newlyAdded = (YourEntityType)e.Entity;
int newId = newlyAdded.Id;
}
谢谢你的答复。你能看看我的另一个问题吗?