【发布时间】:2014-08-09 22:19:58
【问题描述】:
我正在使用 ASP.NET Identity 2.0,并且正在研究注册方法。它开箱即用,但现在我需要在注册过程中将数据添加到另一个表中。
是否可以使用事务创建具有 ASP.NET 身份的用户?这样任何数据都会在出错时被丢弃?
var applicationUser = new ApplicationUser()
{
UserName = model.Email,
Email = model.Email
};
// My application context here will add data to other tables
........
var createResult = await UserManager.CreateAsync(applicationUser, model.Password);
【问题讨论】:
标签: c# asp.net entity-framework-6 asp.net-identity