public async Task <Either <ActionResult, DataGuidanceViewModel> > Update(
            Guid releaseId,
            DataGuidanceUpdateViewModel request)
        {
            return(await _contentPersistenceHelper.CheckEntityExists <Release>(releaseId)
                   .OnSuccessDo(release => _userService.CheckCanUpdateRelease(release))
                   .OnSuccessDo(async release =>
            {
                _contentDbContext.Update(release);
                release.DataGuidance = request.Content;
                await _contentDbContext.SaveChangesAsync();

                await UpdateSubjects(releaseId, request.Subjects);
            })
                   .OnSuccess(BuildViewModel));
        }
Esempio n. 2
0
 public async Task <ActionResult <DataGuidanceViewModel> > Update(Guid releaseId,
                                                                  DataGuidanceUpdateViewModel request)
 {
     return(await _dataGuidanceService.Update(releaseId, request)
            .HandleFailuresOrOk());
 }