public async Task <ActionResult <Country> > PutCountry(int id, Country country) { if (id != country.Id) { return(BadRequest()); } if (await _service.GetEntity(id) == null) { await _service.InsertEntity(country); } else { await _service.UpdateEntity(country); } return(NoContent()); }
public async Task <IActionResult> PutSubject(int id, Subject subject) { if (id != subject.Id) { return(BadRequest()); } if (await _service.GetEntity(id) == null) { await _service.InsertEntity(subject); } else { await _service.UpdateEntity(subject); } return(NoContent()); }
public async Task <IActionResult> PutAlloy(int id, Alloy alloy) { if (id != alloy.Id) { return(BadRequest()); } if (await _service.GetEntity(id) == null) { await _service.InsertEntity(alloy); } else { await _service.UpdateEntity(alloy); } return(NoContent()); }
public async Task <IActionResult> PutCurrency(int id, Currency currency) { if (id != currency.Id) { return(BadRequest()); } if (await _service.GetEntity(id) == null) { await _service.InsertEntity(currency); } else { await _service.UpdateEntity(currency); } return(NoContent()); }