Beispiel #1
0
 /// <summary>
 /// Method for creating a user model view
 /// </summary>
 /// <param name="user"></param>
 /// <param name="roles"></param>
 /// <returns></returns>
 public static UserVm Create(User user, string roles) => new UserVm
 {
     Id                 = user.Id,
     Login              = user.Login,
     Name               = user.Name,
     Phone              = user.PhoneNumber,
     Email              = user.Email,
     Description        = user.Description,
     AssignedRole       = roles,
     Status             = user.Status,
     DataAccess         = DataAccessModel.FromString(user.DataAccess),
     UserRegions        = user.UserRegions.Select(x => x.RegionId.ToString()).ToList(),
     ActiviyCategoryIds = user.ActivitysCategoryUsers.Select(x => x.ActivityCategoryId.ToString()).ToList()
 };
Beispiel #2
0
 /// <summary>
 /// Method for obtaining all data access attributes
 /// </summary>
 /// <returns> </returns>
 public static DataAccessModel GetAllDataAccessAttributes() => DataAccessModel.FromString(null);