コード例 #1
0
        public void Create([FromBody] TechnicalProfile technicalProfile)
        {
            if (!_validator.Validate(technicalProfile).IsValid)
            {
                return;
            }

            _technicalProfileAppService.Add(technicalProfile);
        }
コード例 #2
0
        public void Delete(int id)
        {
            TechnicalProfile technicalProfile = _technicalProfileAppService.GetById(id);

            if (!_validator.Validate(technicalProfile).IsValid)
            {
                return;
            }

            _technicalProfileAppService.Delete(technicalProfile);
        }
コード例 #3
0
        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));
        }