public void Map(CacheConfiguration cacheConfiguration)
 {
     cacheConfiguration.AddCacheService <IProductRepository>(configuration =>
     {
         configuration.AddMethod(x => nameof(x.GetProduct), "prod-{id}", 60);
         configuration.AddMethod(x => nameof(x.GetProductAsync), "prod-async-{id}", 60);
     });
 }
Example #2
0
 public void Map(CacheConfiguration cacheConfiguration)
 {
     cacheConfiguration.AddCacheService <IDefensiveCacheMapping>(configuration =>
     {
         configuration.AddMethod(x => nameof(x.GetBool), "mapGetBool-{id}", 600);
         configuration.AddMethod(x => nameof(x.GetBoolAsync), "mapGetBoolAsync-{id}", 600);
         configuration.AddMethod(x => nameof(x.GetDateTime), "mapGetDateTime-{id}", 600);
         configuration.AddMethod(x => nameof(x.GetDateTimeAsync), "mapGetDateTimeAsync-{id}", 600);
         configuration.AddMethod(x => nameof(x.GetInt), "mapGetInt-{id}", 600);
         configuration.AddMethod(x => nameof(x.GetIntAsync), "mapGetIntAsync-{id}", 600);
         configuration.AddMethod(x => nameof(x.GetListObject), "mapGetListObject-{filter.Page}_{filter.Records}", 600);
         configuration.AddMethod(x => nameof(x.GetListObjectAsync), "mapGetListObjectAsync-{filter.Page}_{filter.Records}", 600);
         configuration.AddMethod(x => nameof(x.GetObject), "mapGetObject-{id}", 600);
         configuration.AddMethod(x => nameof(x.GetObjectAsync), "mapGetObjectAsync-{id}", 600);
         configuration.AddMethod(x => nameof(x.GetString), "mapGetString-{id}", 600);
         configuration.AddMethod(x => nameof(x.GetStringAsync), "mapGetStringAsync-{id}", 600);
     });
 }