diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-01-28 20:59:36 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-01-28 20:59:36 +0200 |
| commit | 55e9e6990b92be1814fb46a40d6b0ff204a8ec60 (patch) | |
| tree | 0a564ab79b987d185e3f023bd5761c824f63e0af /src/DevHive.Data/Repositories | |
| parent | 702e947c20cbdc2c5aaacfa0e8172bfc97912dd2 (diff) | |
| download | DevHive-55e9e6990b92be1814fb46a40d6b0ff204a8ec60.tar DevHive-55e9e6990b92be1814fb46a40d6b0ff204a8ec60.tar.gz DevHive-55e9e6990b92be1814fb46a40d6b0ff204a8ec60.zip | |
Fixed role updating
Diffstat (limited to 'src/DevHive.Data/Repositories')
| -rw-r--r-- | src/DevHive.Data/Repositories/RoleRepository.cs | 12 |
1 files changed, 12 insertions, 0 deletions
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<bool> 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<bool> DoesNameExist(string name) { |
