示例#1
0
 public async Task <ActionResult <IEnumerable <Hero> > > Get()
 {
     try
     {
         return(await _heroesRepository.AllHeroes().ProjectTo <Hero>().ToListAsync().ConfigureAwait(false));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "Failure retrieving heroes.");
         return(StatusCode(Status500InternalServerError));
     }
 }