public async Task <ActionResult> Update(int id, UpdateLegalEntityRequestModel model) { var result = await this.legalEntityService.Update(id, model); if (!result) { return(BadRequest()); } return(NoContent()); }
public async Task <bool> Update(int id, UpdateLegalEntityRequestModel model) { var legalEntity = await this.data.LegalEntity.FindAsync(id); if (legalEntity == null) { return(false); } if (!string.IsNullOrWhiteSpace(model.Description) && legalEntity.Description != model.Description) { legalEntity.Description = model.Description; } if (legalEntity.RegulatoryId != model.RegulatoryId) { legalEntity.RegulatoryId = model.RegulatoryId; } await this.data.SaveChangesAsync(); return(true); }