public List <RoleModelBL> GetAllRoles() { var roles = new List <RoleModelBL>(); _roleRepository.GetAllRoles().ForEach(u => roles.Add(RoleMapBL.RoleModelDAToRoleModelBL(u))); return(roles); }
public RoleModelBL GetRoleById(int id) { var role = _roleRepository.GetRoleById(id); if (role != null) { return(RoleMapBL.RoleModelDAToRoleModelBL(role)); } return(null); }
public RoleModelBL GetRoleByName(string name) { var role = _roleRepository.GetRoleByName(name); if (role != null) { return(RoleMapBL.RoleModelDAToRoleModelBL(role)); } return(null); }
public bool CreateRole(RoleModelBL role) { var newRole = _roleRepository.GetRoleByName(role.Name); if (newRole != null) { return(false); } _roleRepository.Create(RoleMapBL.RoleModelBLToRoleModelDA(role)); return(true); }