Пример #1
0
 public CachingHatService(
     IHatService dataLayer
     , IDistributedCache cache
     , IMapper mapper
     , ILogger <CachingHatService> logger)
 {
     _dataLayer = dataLayer;
     _cache     = cache;
     _mapper    = mapper;
     _logger    = logger;
 }
Пример #2
0
 public async Task <IEnumerable <HatResource> > Get([FromServices] IHatService service)
 {
     _logger.LogInformation("Getting all hats");
     return(await service.GetHatsAsync());
 }
Пример #3
0
 public HatController(IHatService Hat)
 {
     _Hat = Hat;
 }
Пример #4
0
 public async Task <HatResource> Get(Guid hatId, [FromServices] IHatService service)
 {
     _logger.LogInformation("Getting hat", new { hatId });
     return(await service.GetHatAsync(hatId));
 }