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 YiHeUser(string name, UserInfo userInfo)
     : this(name, userInfo.DisplayName, userInfo.UserId, userInfo.RoleName)
 {
     if (userInfo == null) throw new ArgumentNullException("userInfo");
     UserId = userInfo.UserId;
 }