我收到此错误无法设置“User_XXXXXXXXXXXXXXX15F53FF9BEC00DDCC7A54AD9857A0E30CFF2F17D7883FBCF8”类型的属性“角色”,因为该集合已设置为EntityCollection。 我认为错误来自这里
var thisuser = db.Users.Include(u => u.Roles).ToList().FirstOrDefault(u => u.Id == user.Id); !Error Here I think
thisuser.FirstName = user.FirstName;
thisuser.LastName = user.LastName;
thisuser.UserName = user.UserName;
thisuser.Password = user.Password;