From 55e9e6990b92be1814fb46a40d6b0ff204a8ec60 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 28 Jan 2021 20:59:36 +0200 Subject: Fixed role updating --- src/DevHive.Data/Repositories/RoleRepository.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/DevHive.Data') diff --git a/src/DevHive.Data/Repositories/RoleRepository.cs b/src/DevHive.Data/Repositories/RoleRepository.cs index e5cb959..2eeb382 100644 --- a/src/DevHive.Data/Repositories/RoleRepository.cs +++ b/src/DevHive.Data/Repositories/RoleRepository.cs @@ -24,6 +24,18 @@ namespace DevHive.Data.Repositories } #endregion + public override async Task EditAsync(Guid id, Role newEntity) + { + Role role = await this.GetByIdAsync(id); + + this._context + .Entry(role) + .CurrentValues + .SetValues(newEntity); + + return await this.SaveChangesAsync(this._context); + } + #region Validations public async Task DoesNameExist(string name) { -- cgit v1.2.3