Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DevHive.Services / Services / TechnologyService.cs
diff options
context:
space:
mode:
Commitc43a7665b9febe890eb6dac143b62c36464cc94d (patch)
Author
 transtrike <transtrike@gmail.com>
2021-01-17 12:24:17 +0200
Committer
 transtrike <transtrike@gmail.com>
2021-01-17 12:24:17 +0200
Filesf016e79627d0074ccf6f6456c80a91c0410c191f /src/DevHive.Services/Services/TechnologyService.cs
DevHive-c43a7665b9febe890eb6dac143b62c36464cc94d.tar
DevHive-c43a7665b9febe890eb6dac143b62c36464cc94d.tar.gz
DevHive-c43a7665b9febe890eb6dac143b62c36464cc94d.zip
Parente037d611c7ba00d0126a8f954cdc56d7bfeb979e (diff)
Moved Lang&Tech CRUD to Update in User Layer
1 files changed, 2 insertions, 3 deletions
-rw-r--r--src/DevHive.Services/Services/TechnologyService.cs5
diff --git a/src/DevHive.Services/Services/TechnologyService.cs b/src/DevHive.Services/Services/TechnologyService.cs
index d8b7262..c088281 100644
--- a/src/DevHive.Services/Services/TechnologyService.cs
+++ b/src/DevHive.Services/Services/TechnologyService.cs
@@ -48,15 +48,14 @@ namespace DevHive.Services.Services
#region Update
- public async Task<bool> UpdateTechnology(Guid technologyId, UpdateTechnologyServiceModel updateTechnologyServiceModel)
+ public async Task<bool> UpdateTechnology(UpdateTechnologyServiceModel updateTechnologyServiceModel)
{
- if (!await this._technologyRepository.DoesTechnologyExistAsync(technologyId))
+ if (!await this._technologyRepository.DoesTechnologyExistAsync(updateTechnologyServiceModel.Id))
throw new ArgumentException("Technology does not exist!");
if (await this._technologyRepository.DoesTechnologyNameExistAsync(updateTechnologyServiceModel.Name))
throw new ArgumentException("Technology name already exists!");
- updateTechnologyServiceModel.Id = technologyId;
Technology technology = this._technologyMapper.Map<Technology>(updateTechnologyServiceModel);
bool result = await this._technologyRepository.EditAsync(technology);