diff options
| author | transtrike <transtrike@gmail.com> | 2021-01-17 12:24:17 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2021-01-17 12:24:17 +0200 |
| commit | c43a7665b9febe890eb6dac143b62c36464cc94d (patch) | |
| tree | f016e79627d0074ccf6f6456c80a91c0410c191f /src/DevHive.Services/Services/TechnologyService.cs | |
| parent | e037d611c7ba00d0126a8f954cdc56d7bfeb979e (diff) | |
| download | DevHive-c43a7665b9febe890eb6dac143b62c36464cc94d.tar DevHive-c43a7665b9febe890eb6dac143b62c36464cc94d.tar.gz DevHive-c43a7665b9febe890eb6dac143b62c36464cc94d.zip | |
Moved Lang&Tech CRUD to Update in User Layer
Diffstat (limited to 'src/DevHive.Services/Services/TechnologyService.cs')
| -rw-r--r-- | src/DevHive.Services/Services/TechnologyService.cs | 5 |
1 files changed, 2 insertions, 3 deletions
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); |
