public async Task <IActionResult> Edit(Guid id, OrganizationEditModel model) { var organization = await _organizationRepository.GetByIdAsync(id); if (organization == null) { return(RedirectToAction("Index")); } model.ToOrganization(organization); await _organizationRepository.ReplaceAsync(organization); return(RedirectToAction("Edit", new { id })); }
public async Task <IActionResult> Edit(Guid id, OrganizationEditModel model) { var organization = await _organizationRepository.GetByIdAsync(id); model.ToOrganization(organization); await _organizationRepository.ReplaceAsync(organization); await _applicationCacheService.UpsertOrganizationAbilityAsync(organization); await _referenceEventService.RaiseEventAsync(new ReferenceEvent(ReferenceEventType.OrganizationEditedByAdmin, organization) { EventRaisedByUser = _userService.GetUserName(User), SalesAssistedTrialStarted = model.SalesAssistedTrialStarted, }); return(RedirectToAction("Edit", new { id })); }