public void Create([FromBody] TechnicalProfile technicalProfile) { if (!_validator.Validate(technicalProfile).IsValid) { return; } _technicalProfileAppService.Add(technicalProfile); }
public void Delete(int id) { TechnicalProfile technicalProfile = _technicalProfileAppService.GetById(id); if (!_validator.Validate(technicalProfile).IsValid) { return; } _technicalProfileAppService.Delete(technicalProfile); }
public ActionResult <TechnicalProfile> Update(int id, [FromBody] TechnicalProfile technicalProfile) { TechnicalProfile profileToUpd = _technicalProfileAppService.GetById(id); if (!_validator.Validate(technicalProfile).IsValid) { return(BadRequest()); } profileToUpd.Id = id; profileToUpd.Name = technicalProfile.Name; profileToUpd.Description = technicalProfile.Description; TechnicalProfile profileUpdated = _technicalProfileAppService.Update(id, profileToUpd); return(Ok(profileUpdated)); }