public async Task <IActionResult> UpdateCompanyAndHeadquarter([FromBody] CompanyHeadquarterModel model) { manager.UpdateCompanyAndHeadquarter(model); var companies = manager.GetCompanies(); return(Ok(companies)); }
public void UpdateCompanyAndHeadquarter(CompanyHeadquarterModel model) { var company = GetCompanyById(model.Id); var headquarter = GetHeadquarterById(company.HeadquarterId); company.Name = model.Name; headquarter.Country = model.Country; headquarter.City = model.City; headquarter.Street = model.Street; db.Companies.Update(company); db.Headquarters.Update(headquarter); db.SaveChanges(); }
public void UpdateCompanyAndHeadquarter(CompanyHeadquarterModel model) { repository.UpdateCompanyAndHeadquarter(model); }