public async Task <IActionResult> ForceImport([FromBody] ReprocessForceImport command) { await rules .MustNotHaveExistingPendingOutcome() .EnsureValidProfileId() .Apply(command, ModelState); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await elrService.Execute(command); return(Ok()); }
public async Task Execute(ReprocessForceImport command) { foreach (var observation in command.ObservationKeys) { await writeContext.ElrOutcome.AddAsync(new Data.ElrOutcome { CdAction = DispositionType.AutoImport, IdElrObservation = observation, IdProfile = command.ProfileId, IdStateno = command.StateNo }); } await Execute(new RefilterObservations { ObservationKeys = command.ObservationKeys }); await writeContext.SaveChangesAsync(); }