Пример #1
0
 public EditMyAccountViewModel(IEnumerable <IdentityRole> roles, IEnumerable <string> rolesForUser, Data.Models.MoxUser user) : base(roles, rolesForUser, user)
 {
     this.IsAdmin = rolesForUser.Contains(Constants.AdminRole);
 }
Пример #2
0
        public EditUserViewModel(IEnumerable <IdentityRole> roles, IEnumerable <string> rolesForUser, Data.Models.MoxUser user)
        {
            this.Roles = roles.Select(x => new RoleViewModel()
            {
                Id = x.Id, Name = x.Name, Checked = rolesForUser.Contains(x.Name)
            }).ToArray();

            this.Id    = user.Id;
            this.Name  = user.Name;
            this.Email = user.Email;
        }