public async Task SaveRaceAsync(Race race)
        {
            await _readerRepository.SaveReader(race.Reader);

            await _readingRepository.SaveReading(race.Reading);

            await _readRepository.DeleteByReadingId(race.Reading.Id);

            await _readRepository.SaveReadRangeAsync(race.Reads);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Save([FromBody] Reader reader)
        {
            try
            {
                await _repository.SaveReader(reader);

                var description = new ReaderDescription
                {
                    Description = Utilities.BuildReaderDescription(reader)
                };
                return(Ok(description));
            }
            catch (Exception ex)
            {
                _logger.LogError("Error saving {reader}: {exception}", reader, ex);
                return(BadRequest());
            }
        }
Ejemplo n.º 3
0
 public async Task AddOrUpdateAsync(Reader reader)
 {
     await _readerRepository.SaveReader(reader);
 }