diff options
Diffstat (limited to 'src/DevHive.Data')
| -rw-r--r-- | src/DevHive.Data/Repositories/TechnologyRepository.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/DevHive.Data/Repositories/TechnologyRepository.cs b/src/DevHive.Data/Repositories/TechnologyRepository.cs index a41d4fb..6853893 100644 --- a/src/DevHive.Data/Repositories/TechnologyRepository.cs +++ b/src/DevHive.Data/Repositories/TechnologyRepository.cs @@ -46,12 +46,13 @@ namespace DevHive.Data.Repositories #endregion #region Edit - - public async Task<bool> EditAsync(Technology newEntity) + public async Task<bool> EditAsync(Technology entity) { - this._context - .Set<Technology>() - .Update(newEntity); + Technology technology = await this._context.Technologies + .FirstOrDefaultAsync(x => x.Id == entity.Id); + + this._context.Update(technology); + this._context.Entry(entity).CurrentValues.SetValues(entity); return await this.SaveChangesAsync(this._context); } |
