private static UserInfo CreateUserContextFromUser(User user)
        {
            var userContext = new UserInfo
            {
                UserId = user.UserId,
                DisplayName = user.DisplayName,
                UserIdentifier = user.Email,
                RoleName=Enum.GetName(typeof(UserRoles),user.RoleId)
            };

            return userContext;
        }
示例#2
0
 public FNHMVCUser(string name, UserInfo userInfo)
     : this(name, userInfo.DisplayName, userInfo.UserId,userInfo.RoleName)
 {
     if (userInfo == null) throw new ArgumentNullException("userInfo");
     this.UserId = userInfo.UserId;
 }