Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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();
        }