public async Task <Location> GetLocationOfAccidentAsync(string accidentId) { AccidentEntity accidentEntity = await this.accidentRepository .RetrieveOneOrThrowArgumentExceptionAsync(accidentId) .ConfigureAwait(false); return(accidentEntity.Location.ToModel()); }
public async Task <Accident> CreateAccidentAsync(Accident accident) { accident.Id = Guid.NewGuid().ToString(); AccidentEntity accidentEntity = AccidentEntity.From(accident); await this.accidentRepository .InsertOneAsync(accidentEntity) .ConfigureAwait(false); return(accident); }
public async Task UpdateAccidentAsync(Accident accident) { await this.accidentRepository .UpdateOneOrThrowArgumentExceptionAsync(AccidentEntity.From(accident)) .ConfigureAwait(false); }