【发布时间】:2013-05-20 04:21:44
【问题描述】:
我正在使用 MVC 4,我正在尝试向 UserProfile 添加一个名为 AdditionalById 的新字段(用于管理事务)。
这是我所拥有的:
WebSecurity.CreateUserAndAccount(model.UserName, model.Password, new
{
FirstName = model.FirstName,
LastName = model.LastName,
AddedDate = DateTime.UtcNow
AddedByID = // to sure how to get the id because the account has not been created yet.
});
我应该在创建帐户后更新 AddById 吗?
【问题讨论】:
-
既然已经拥有
Userid和Userprofile,为什么还需要它? -
@KomengeMwandila 因为支持团队可以为某人创建帐户。
-
如果管理员正在创建帐户,则该用户已登录...因此您拥有 ID,并且可以在创建新帐户时包含它。
标签: asp.net-mvc-4 simplemembership