public async Task <IActionResult> Put([FromBody] AccountType value, [FromRoute] int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != value.AccountTypeId) { return(BadRequest()); } if (value.Code == null) { value.Code = await _sequenceRepository.GetCode("AccountType"); } await _accounttypeRepository.UpdateAsync(value); return(Ok(value)); }