diff options
Diffstat (limited to 'src/DevHive.Services/Services/RoleService.cs')
| -rw-r--r-- | src/DevHive.Services/Services/RoleService.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/DevHive.Services/Services/RoleService.cs b/src/DevHive.Services/Services/RoleService.cs index d5c1848..c0b9062 100644 --- a/src/DevHive.Services/Services/RoleService.cs +++ b/src/DevHive.Services/Services/RoleService.cs @@ -1,9 +1,9 @@ using System; using System.Threading.Tasks; using AutoMapper; +using DevHive.Common.Models.Identity; using DevHive.Data.Models; using DevHive.Data.Repositories; -using DevHive.Services.Models.Identity.Role; namespace DevHive.Services.Services { @@ -18,7 +18,7 @@ namespace DevHive.Services.Services this._roleMapper = mapper; } - public async Task<bool> CreateRole(RoleServiceModel roleServiceModel) + public async Task<bool> CreateRole(RoleModel roleServiceModel) { if (await this._roleRepository.DoesNameExist(roleServiceModel.Name)) throw new ArgumentException("Role already exists!"); @@ -28,15 +28,15 @@ namespace DevHive.Services.Services return await this._roleRepository.AddAsync(role); } - public async Task<RoleServiceModel> GetRoleById(Guid id) + public async Task<RoleModel> GetRoleById(Guid id) { Role role = await this._roleRepository.GetByIdAsync(id) ?? throw new ArgumentException("Role does not exist!"); - return this._roleMapper.Map<RoleServiceModel>(role); + return this._roleMapper.Map<RoleModel>(role); } - public async Task<bool> UpdateRole(RoleServiceModel roleServiceModel) + public async Task<bool> UpdateRole(RoleModel roleServiceModel) { if (!await this._roleRepository.DoesRoleExist(roleServiceModel.Id)) throw new ArgumentException("Role does not exist!"); |
