好的,我需要将字段 Active 更新为 True 这是代码
public static bool FirstLogin(Guid ActivationCode)
{
using (InfinityNightDataContext data = new InfinityNightDataContext())
{
User user = data.Users.Single(User => User.EmailActivation == ActivationCode);
if (user != null)
{
user.Active = true;
user.Exp = "i HAs here";
data.SubmitChanges();
InstallMembershipCookie(user.UserId, user.Email, user.Password, user.UserType, user.FirstName, user.UserImg, "", true);
return true;
}
else
{
return false;
}
}
}
和之后data.SubmitChanges()
;我可以看到对象用户的更改,但在其他功能中看不到数据库中的更改,但在这种情况下,它不起作用..
有谁知道是什么问题?