Esempio n. 1
0
 public Company NewCompany(UpdatedCompanyProfileDto updatedCompany)
 {
     return(new Company()
     {
         Id = updatedCompany.Id,
         Name = updatedCompany.Name,
         Tin = updatedCompany.Tin,
         Country = updatedCompany.Country,
         City = updatedCompany.City,
         SubCity = updatedCompany.SubCity,
         Location = updatedCompany.Location
     });
 }
        public IActionResult UpdateCompanyProfile(uint id, [FromBody] UpdatedCompanyProfileDto updatedProfile)
        {
            if (updatedProfile == null)
            {
                return(StatusCode(400));
            }
            if (!ModelState.IsValid)
            {
                return(new InvalidInputResponse(ModelState));
            }

            var profile = _factory.NewCompany(updatedProfile);
            var result  = _command.UpdateProfile(profile);

            if (result == true)
            {
                return(StatusCode(204));
            }

            return(StatusCode(500));
        }