public ActionResult <CovidObservationDatumDto> CreateCovidCaseDatum(CovidObservationDatumInputDto covidObservationsDatum) { var entity = _covidCaseDataMapper.ToCovidObservationDatum(covidObservationsDatum); _dashBoardRepository.AddCovidObservationsDatum(entity); _dashBoardRepository.Save(); var result = _covidCaseDataMapper.ToCovidCaseDataDto(entity); return(CreatedAtRoute("GetSpecificData", new { caseId = entity.Id }, result)); }
public ActionResult <IEnumerable <CovidObservationDatumDto> > CreateObservationCollection( IEnumerable <CovidObservationDatumInputDto> observationCollection) { var collection = _covidObservationDataMapper.ToObservationCollection(observationCollection); foreach (var item in collection) { _covidObservationsDataRepository.AddCovidObservationsDatum(item); _covidObservationsDataRepository.Save(); } var result = _covidObservationDataMapper.ToCovidCaseDataListDto(collection); return(Ok(result)); }