public async Task <IActionResult> Update(TechnologyUpdateRequestModel technologyUpdateRequestModel) { var isTechnologyUpdateSuccessful = await this.techologyService.UpdateTechnology(technologyUpdateRequestModel); if (!isTechnologyUpdateSuccessful) { return(BadRequest()); } return(Ok()); }
public async Task <bool> UpdateTechnology(TechnologyUpdateRequestModel technologyUpdateRequestModel) { var technology = await this.GetTechnologyById(technologyUpdateRequestModel.Id); if (technology == null) { return(false); } technology.Title = technologyUpdateRequestModel.Title; technology.Description = technologyUpdateRequestModel.Description; await this.personalBlogDbContext.SaveChangesAsync(); return(true); }