public IdentityResult UpdateRole(ApplicationIdentityRoleDto roleDto) { var role = mapper.Map <IdentityRole>(roleDto); Context.Entry(role).State = Microsoft.EntityFrameworkCore.EntityState.Modified; if (SaveChanges() == 1) { return(IdentityResult.Success); } else { return(IdentityResult.Failed()); } }
public IdentityResult CreateRole(ApplicationIdentityRoleDto roleDto) { roleDto.Id = GetSecureId(); var role = mapper.Map <IdentityRole>(roleDto); Context.Entry(role).State = Microsoft.EntityFrameworkCore.EntityState.Added; if (SaveChanges() == 1) { return(IdentityResult.Success); } else { return(IdentityResult.Failed()); } }
public void SetNormalizedRoleName([FromBody] ApplicationIdentityRoleDto role, string normalizedName) { _authenticationManager.SetNormalizedRoleName(role, normalizedName); }
public void SetIdentityRoleDtoName([FromBody] ApplicationIdentityRoleDto role, string roleName) { _authenticationManager.SetIdentityRoleDtoName(role, roleName); }
public string GetNormalizedRoleName([FromQuery] ApplicationIdentityRoleDto role) { return(_authenticationManager.GetNormalizedRoleName(role)); }
public string GetIdentityRoleDtoId([FromQuery] ApplicationIdentityRoleDto role) { return(_authenticationManager.GetIdentityRoleDtoId(role)); }
public IdentityResult CreateRole([FromBody] ApplicationIdentityRoleDto role) { return(_authenticationManager.CreateRole(role)); }
public void SetNormalizedRoleName(ApplicationIdentityRoleDto role, string normalizedName) { throw new NotImplementedException(); }
public void SetIdentityRoleDtoName(ApplicationIdentityRoleDto role, string roleName) { throw new NotImplementedException(); }
public string GetNormalizedRoleName(ApplicationIdentityRoleDto roleDto) { var role = Context.Set <IdentityRole>().Where(r => r.Id == roleDto.Id || r.Name == roleDto.Name).SingleOrDefault(); return(role?.Name.Trim()); }
public string GetIdentityRoleDtoId(ApplicationIdentityRoleDto roleDto) { var role = Context.Set <IdentityRole>().Where(r => r.Id == roleDto.Id || r.Name == roleDto.Name).FirstOrDefault(); return(role?.Id); }