├── .editorconfig ├── .gitattributes ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── Benchmarks.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── COPYRIGHT.txt ├── CacheManager.sln ├── Documentation ├── GetMsdn.cmd ├── api │ └── index.md ├── apispec │ ├── CacheManager_Core_CacheFactory_Build_System_String_System_Action_CacheManager_Core_ConfigurationBuilderCachePart__.md │ ├── CacheManager_Core_JsonConfigurationBuilderExtensions.md │ ├── CacheManager_Core_MicrosoftConfigurationExtensions.md │ └── CacheManager_Core_MicrosoftLoggingBuilderExtensions.md ├── build.cmd ├── docfx.json ├── index.md ├── template │ ├── ManagedReference.html.primary.tmpl │ ├── partials │ │ └── enum.tmpl.partial │ └── toc.html.tmpl └── toc.yml ├── LICENSE ├── NuGet.Config ├── README.md ├── azure-pipelines-ci.yml ├── benchmarks ├── CacheManager.Benchmarks │ ├── .gitignore │ ├── BackplaneMessageBenchmark.cs │ ├── BaseCacheManagerBenchmark.cs │ ├── CacheManager.Benchmarks.csproj │ ├── GzBenchmark.cs │ ├── PlainDictionaryUpdateBenchmark.cs │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SerializationBenchmark.cs │ ├── TestPoco.cs │ └── UnixTimestampBenchmark.cs ├── CacheManager.Config.Tests │ ├── CacheManager.Config.Tests.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Settings.StyleCop │ ├── Tests.cs │ └── cache.json └── CacheManager.Events.Tests │ ├── CacheEvent.cs │ ├── CacheManager.Events.Tests.csproj │ ├── EventCommand.cs │ ├── EventHandling.cs │ ├── MemoryOnlyCommand.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── RedisAndMemoryCommand.cs │ └── Spinner.cs ├── samples ├── AspNetCore │ ├── Controllers │ │ ├── InfoController.cs │ │ └── ValuesController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── Web.csproj │ ├── appsettings.json │ ├── cache.json │ └── web.config └── CacheManager.Examples │ ├── App.config │ ├── CacheManager.Examples.csproj │ ├── Program.cs │ └── Properties │ └── AssemblyInfo.cs ├── src ├── CacheManager.Core │ ├── BaseCacheManager.Expire.cs │ ├── BaseCacheManager.GetOrAdd.cs │ ├── BaseCacheManager.Update.cs │ ├── BaseCacheManager.cs │ ├── CacheFactory.cs │ ├── CacheHandleConfiguration.cs │ ├── CacheItem.cs │ ├── CacheManager.Core.csproj │ ├── CacheManagerConfiguration.cs │ ├── CacheUpdateMode.cs │ ├── Configuration │ │ ├── CacheConfigurationBuilder.cs │ │ └── CacheManagerSection.cs │ ├── ExpirationMode.cs │ ├── ICache.cs │ ├── ICacheManager.cs │ ├── ICacheManagerConfiguration.cs │ ├── Internal │ │ ├── BackplaneMessage.cs │ │ ├── BaseCache.cs │ │ ├── BaseCacheHandle.cs │ │ ├── CacheBackplane.cs │ │ ├── CacheEventArgs.cs │ │ ├── CacheReflectionHelper.cs │ │ ├── CacheSerializer.cs │ │ ├── CacheStats.cs │ │ ├── CacheStatsCounter.cs │ │ ├── CacheStatsCounterType.cs │ │ ├── DictionaryCacheHandle.cs │ │ ├── ICacheItemProperties.cs │ │ ├── ICacheSerializer.cs │ │ ├── RequiresSerializerAttribute.cs │ │ ├── SerializerCacheItem.cs │ │ ├── TypeCache.cs │ │ └── UpdateItemResult.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Utility │ │ └── Guard.cs ├── CacheManager.Microsoft.Extensions.Caching.Memory │ ├── CacheManager.Microsoft.Extensions.Caching.Memory.csproj │ ├── MemoryCacheExtensions.cs │ ├── MemoryCacheHandle`1.cs │ ├── MicrosoftMemoryCachingBuilderExtensions.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── CacheManager.Microsoft.Extensions.Configuration │ ├── CacheManager.Microsoft.Extensions.Configuration.csproj │ ├── MicrosoftConfigurationExtensions.cs │ └── ServiceCollectionExtensions.cs ├── CacheManager.Serialization.Bond │ ├── BondCacheItem.cs │ ├── BondCompactBinaryCacheSerializer.cs │ ├── BondConfigurationBuilderExtensions.cs │ ├── BondFastBinaryCacheSerializer.cs │ ├── BondSerializerBase.cs │ ├── BondSimpleJsonCacheSerializer.cs │ ├── CacheManager.Serialization.Bond.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── SerializerCache.cs ├── CacheManager.Serialization.DataContract │ ├── CacheManager.Serialization.DataContract.csproj │ ├── DataContractBinaryCacheSerializer.cs │ ├── DataContractCacheItem.cs │ ├── DataContractCacheSerializer.cs │ ├── DataContractCacheSerializerBase.cs │ ├── DataContractConfigurationBuilderExtensions.cs │ ├── DataContractGzJsonCacheSerializer.cs │ ├── DataContractJsonCacheSerializer.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── CacheManager.Serialization.Json │ ├── CacheManager.Serialization.Json.csproj │ ├── GzJsonCacheSerializer.cs │ ├── JsonCacheItem.cs │ ├── JsonCacheSerializer.cs │ ├── JsonConfigurationBuilderExtensions.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── CacheManager.Serialization.ProtoBuf │ ├── CacheManager.Serialization.ProtoBuf.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ProtoBufCacheItem.cs │ ├── ProtoBufConfigurationBuilderExtensions.cs │ └── ProtoBufSerializer.cs ├── CacheManager.StackExchange.Redis │ ├── CacheManager.StackExchange.Redis.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RedisCacheBackplane.cs │ ├── RedisCacheHandle.cs │ ├── RedisConfiguration.cs │ ├── RedisConfigurationBuilder.cs │ ├── RedisConfigurationBuilderExtensions.cs │ ├── RedisConfigurationSection.cs │ ├── RedisConfigurations.cs │ ├── RedisConnectionManager.cs │ ├── RedisValueConverter.cs │ ├── RetryHelper.cs │ └── ScriptType.cs └── CacheManager.SystemRuntimeCaching │ ├── CacheManager.SystemRuntimeCaching.csproj │ ├── MemoryCacheHandle`1.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── RuntimeCachingBuilderExtensions.cs │ └── RuntimeMemoryCacheOptions.cs ├── test ├── CacheManager.MSConfiguration.TypeLoad.Tests │ ├── CacheManager.MSConfiguration.TypeLoad.Tests.csproj │ ├── MicrosoftConfigurationTests.cs │ ├── Properties │ │ └── launchSettings.json │ └── xunit.runner.json └── CacheManager.Tests │ ├── BackplaneMessageTest.cs │ ├── CacheFactoryTests.cs │ ├── CacheItemValidation.cs │ ├── CacheManager.Tests.csproj │ ├── CacheManagerAdvancedUpdateTests.cs │ ├── CacheManagerEventsTest.cs │ ├── CacheManagerExpirationTest.cs │ ├── CacheManagerRegionTests.cs │ ├── CacheManagerSimpleTests.cs │ ├── CacheManagerStatsTest.cs │ ├── Configuration │ ├── configuration.ExpireTest.config │ ├── configuration.invalid.ExpirationWithoutTimeout.config │ ├── configuration.invalid.InvalidEnablePerfCounters.config │ ├── configuration.invalid.InvalidEnableStats.config │ ├── configuration.invalid.InvalidExpMode.config │ ├── configuration.invalid.InvalidRef.config │ ├── configuration.invalid.InvalidTimeout.config │ ├── configuration.invalid.InvalidUpdateMode.config │ ├── configuration.invalid.MaxRetries.config │ ├── configuration.invalid.RetryTimeout.config │ ├── configuration.invalid.backplaneNameNoType.config │ ├── configuration.invalid.backplaneTypeNoName.config │ ├── configuration.invalid.emptyHandleDefinition.config │ ├── configuration.invalid.invalidDefExpMode.config │ ├── configuration.invalid.invalidDefTimeout.config │ ├── configuration.invalid.invalidType.config │ ├── configuration.invalid.managerWithoutHandles.config │ ├── configuration.invalid.missingDefId.config │ ├── configuration.invalid.missingName.config │ ├── configuration.invalid.missingType.config │ ├── configuration.invalid.noSection.config │ ├── configuration.invalid.serializerType.config │ └── configuration.valid.allFeatures.config │ ├── ExcludeFromCodeCoverageAttribute.cs │ ├── InvalidConfigurationValidationTests.cs │ ├── LoggingTests.cs │ ├── MemoryCacheTests.cs │ ├── MicrosoftConfigurationTests.cs │ ├── MicrosoftLoggingTests.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── RedisTestFixture.cs │ ├── RedisTests.cs │ ├── ReplaceCultureAttribute.cs │ ├── SerializerTests.cs │ ├── SystemWebCacheHandleWrapper.cs │ ├── TestCacheManagers.cs │ ├── TestConfigurationHelper.cs │ ├── TestHelper.cs │ ├── TestModel.cs │ ├── ThreadRandomReadWriteTestBase.cs │ ├── ThreadTestHelper.cs │ ├── ValidConfigurationValidationTests.cs │ ├── app.config │ ├── testhost.dll.config │ ├── testhost.x86.dll.config │ └── xunit.runner.json └── tools ├── CacheManagerCfg.xsd ├── CodeAnalysis.ruleset ├── RedisCfg.xsd ├── cacheManager.json ├── common.props ├── icon.png ├── key.snk └── version.props /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: MichaCo 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: feature request 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | *.lock.json 9 | 10 | /Documentation/_site 11 | /Documentation/api/*.yml 12 | /Documentation/api/*.manifest 13 | /Documentation/msdn.4.5.2 14 | /Documentation/packages 15 | /Documentation/.nuget 16 | /.nuget/nuget.exe 17 | 18 | # Build results 19 | 20 | [Dd]ebug/ 21 | [Rr]elease/ 22 | x64/ 23 | build/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | 27 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 28 | !packages/*/build/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | *_i.c 35 | *_p.c 36 | *.ilk 37 | *.meta 38 | *.obj 39 | *.pch 40 | *.pdb 41 | *.pgc 42 | *.pgd 43 | *.rsp 44 | *.sbr 45 | *.tlb 46 | *.tli 47 | *.tlh 48 | *.tmp 49 | *.tmp_proj 50 | *.log 51 | *.vspscc 52 | *.vssscc 53 | .builds 54 | *.pidb 55 | *.log 56 | *.scc 57 | 58 | # Visual C++ cache files 59 | ipch/ 60 | *.aps 61 | *.ncb 62 | *.opensdf 63 | *.sdf 64 | *.cachefile 65 | 66 | # Visual Studio profiler 67 | *.psess 68 | *.vsp 69 | *.vspx 70 | 71 | # Guidance Automation Toolkit 72 | *.gpState 73 | 74 | # ReSharper is a .NET coding add-in 75 | _ReSharper*/ 76 | *.[Rr]e[Ss]harper 77 | 78 | # TeamCity is a build add-in 79 | _TeamCity* 80 | 81 | # DotCover is a Code Coverage Tool 82 | *.dotCover 83 | 84 | # NCrunch 85 | *.ncrunch* 86 | .*crunch*.local.xml 87 | 88 | # Installshield output folder 89 | [Ee]xpress/ 90 | 91 | # DocProject is a documentation generator add-in 92 | DocProject/buildhelp/ 93 | DocProject/Help/*.HxT 94 | DocProject/Help/*.HxC 95 | DocProject/Help/*.hhc 96 | DocProject/Help/*.hhk 97 | DocProject/Help/*.hhp 98 | DocProject/Help/Html2 99 | DocProject/Help/html 100 | 101 | # Click-Once directory 102 | publish/ 103 | 104 | # Publish Web Output 105 | *.Publish.xml 106 | 107 | # NuGet Packages Directory 108 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 109 | #packages/ 110 | 111 | # Windows Azure Build Output 112 | csx 113 | *.build.csdef 114 | 115 | # Windows Store app package directory 116 | AppPackages/ 117 | 118 | # Others 119 | sql/ 120 | *.Cache 121 | ClientBin/ 122 | [Ss]tyle[Cc]op.* 123 | ~$* 124 | *~ 125 | *.dbmdl 126 | *.[Pp]ublish.xml 127 | *.pfx 128 | *.publishsettings 129 | 130 | # RIA/Silverlight projects 131 | Generated_Code/ 132 | 133 | # Backup & report files from converting an old project file to a newer 134 | # Visual Studio version. Backup files are not needed, because we have git ;-) 135 | _UpgradeReport_Files/ 136 | Backup*/ 137 | UpgradeLog*.XML 138 | UpgradeLog*.htm 139 | 140 | # SQL Server files 141 | App_Data/*.mdf 142 | App_Data/*.ldf 143 | 144 | 145 | #LightSwitch generated files 146 | GeneratedArtifacts/ 147 | _Pvt_Extensions/ 148 | ModelManifest.xml 149 | 150 | # ========================= 151 | # Windows detritus 152 | # ========================= 153 | 154 | # Windows image file caches 155 | Thumbs.db 156 | ehthumbs.db 157 | 158 | # Folder config file 159 | Desktop.ini 160 | 161 | # Recycle Bin used on file shares 162 | $RECYCLE.BIN/ 163 | 164 | # Mac desktop service store files 165 | .DS_Store 166 | /packages 167 | /samples/CacheManager.Examples/packages 168 | *.rdb 169 | /.vs/config/applicationhost.config 170 | /tools/redis/packages/Redis-64 171 | /tools/redis/.nuget 172 | /.build 173 | /.vs 174 | /Documentation/DocFxBin 175 | /Documentation/*.zip 176 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@michaconrad.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /COPYRIGHT.txt: -------------------------------------------------------------------------------- 1 | Copyright 2014 MichaConrad 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /Documentation/GetMsdn.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd %~dp0 3 | 4 | SETLOCAL 5 | SET NUGET_VERSION=latest 6 | SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe 7 | 8 | IF EXIST %CACHED_NUGET% goto copynuget 9 | 10 | echo Downloading latest version of NuGet.exe... 11 | IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet 12 | @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'" 13 | 14 | :copynuget 15 | IF EXIST .nuget\nuget.exe goto restore 16 | md .nuget 17 | copy %CACHED_NUGET% .nuget\nuget.exe > nul 18 | 19 | :restore 20 | IF EXIST msdn.4.5.2 goto exit 21 | .nuget\nuget.exe install msdn.4.5.2 -pre -ExcludeVersion 22 | 23 | :exit -------------------------------------------------------------------------------- /Documentation/api/index.md: -------------------------------------------------------------------------------- 1 | # Api Documentation 2 | 3 | Here you can find the CacheManager API reference documentation generated with [docfx](https://dotnet.github.io/docfx/). -------------------------------------------------------------------------------- /Documentation/apispec/CacheManager_Core_CacheFactory_Build_System_String_System_Action_CacheManager_Core_ConfigurationBuilderCachePart__.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: CacheManager.Core.CacheFactory.Build(System.String,System.Action{CacheManager.Core.ConfigurationBuilderCachePart}) 3 | remarks: 4 | --- 5 | 6 | The following example shows how to use this overload to build a CacheManagerConfiguration 7 | and pass it to the CacheFactory to create a new CacheManager instance. 8 | 9 | ```csharp 10 | var cache = cachefactory.build("mycachename", settings => 11 | { 12 | settings 13 | .withupdatemode(cacheupdatemode.up) 14 | .withdictionaryhandle() 15 | .enableperformancecounters() 16 | .withexpiration(expirationmode.sliding, timespan.fromseconds(10)); 17 | }); 18 | 19 | cache.add("key", "value"); 20 | ``` 21 | -------------------------------------------------------------------------------- /Documentation/apispec/CacheManager_Core_JsonConfigurationBuilderExtensions.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: CacheManager.Core.JsonConfigurationBuilderExtensions 3 | --- 4 | 5 | Configuring CacheManager to use the JSON serializer will replace the default Binary serializer. 6 | 7 | ##### **Usage** 8 | 9 | Basic usage example: 10 | 11 | ```csharp 12 | var builder = new Core.ConfigurationBuilder(); 13 | builder.WithJsonSerializer(); 14 | ``` 15 | 16 | optionally, `Newtonsoft.Json.JsonSerializerSettings` can be specified for (de)serialization. 17 | See the [official documentation](http://www.newtonsoft.com/json/help/html/SerializationSettings.htm) for more details. 18 | 19 | ```csharp 20 | builder.WithJsonSerializer(new JsonSerializerSettings(), new JsonSerializerSettings()); 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /Documentation/apispec/CacheManager_Core_MicrosoftConfigurationExtensions.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: CacheManager.Core.MicrosoftConfigurationExtensions 3 | remarks: 'To be able to use the different configuration providers like JSON or XML, you have to install the corresponding 4 | `Microsoft.Extensions.Configuration.*` package(s).' 5 | --- 6 | 7 | ##### **Usage** 8 | 9 | The following is a basic example of how to use the extensions. See the [configuration documentation](http://cachemanager.michaco.net/Documentation/Index/cachemanager_configuration) for more details. 10 | 11 | ```csharp 12 | // setting up the configuration providers 13 | var builder = new Microsoft.Extensions.Configuration.ConfigurationBuilder() 14 | .AddJsonFile("cache.json"); 15 | 16 | // build the configuration 17 | this.Configuration = builder.Build(); 18 | 19 | // retrieve the CacheManager configuration 20 | var jsonConfiguration = 21 | this.Configuration.GetCacheConfiguration(); 22 | ``` 23 | 24 | To create a JSON cache configuration, create a new `.json` file and use the [cachemanager.json](http://cachemanager.michaco.net/schemas/cachemanager.json) schema to 25 | get all the benefits of IntelliSense and validation. 26 | 27 | ```JSON 28 | { 29 | "$schema": "http://cachemanager.michaco.net/schemas/cachemanager.json", 30 | "cacheManagers": [ 31 | { 32 | "name": "MyCache", 33 | "handles": [ { "knownType": "SystemRuntime" } ] 34 | } 35 | } 36 | ``` -------------------------------------------------------------------------------- /Documentation/apispec/CacheManager_Core_MicrosoftLoggingBuilderExtensions.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: CacheManager.Core.MicrosoftLoggingBuilderExtensions 3 | remarks: 'To use the different log providers, install the corresponding `Microsoft.Extensions.Logging.*` package.' 4 | --- 5 | 6 | ##### **Usage** 7 | 8 | Either configure a CacheManager specific logger factory: 9 | 10 | ```csharp 11 | var builder = new Core.ConfigurationBuilder("myCache"); 12 | builder.WithMicrosoftLogging(f => 13 | { 14 | f.AddConsole(LogLevel.Information); 15 | f.AddDebug(LogLevel.Verbose); 16 | }); 17 | ``` 18 | 19 | Or pass in an existing `ILoggerFactory`: 20 | 21 | ```csharp 22 | var builder = new Core.ConfigurationBuilder("myCache"); 23 | builder.WithMicrosoftLogging(loggerFactory); 24 | ``` 25 | 26 | -------------------------------------------------------------------------------- /Documentation/build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd %~dp0 3 | 4 | call GetMsdn.cmd 5 | 6 | SETLOCAL 7 | SET DOCFX_VERSION=2.16.7 8 | SET CACHED_ZIP=%LocalAppData%\DocFx\docfx.%DOCFX_VERSION%.zip 9 | 10 | IF EXIST %CACHED_ZIP% goto extract 11 | echo Downloading latest version of docfx... 12 | IF NOT EXIST %LocalAppData%\DocFx md %LocalAppData%\DocFx 13 | SET DWL_FILE=https://github.com/dotnet/docfx/releases/download/v%DOCFX_VERSION%/docfx.zip 14 | echo Downloading %DWL_FILE% 15 | @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest '%DWL_FILE%' -OutFile '%CACHED_ZIP%'" 16 | 17 | :extract 18 | 19 | copy %CACHED_ZIP% docfx.zip > nul 20 | 21 | RMDIR /S /Q "DocFxBin" 22 | IF NOT EXIST \DocFxBin md \DocFxBin 23 | @powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('docfx.zip', 'DocFxBin'); }" 24 | 25 | :restore 26 | 27 | :run 28 | 29 | rd /S /Q ..\..\cachemanager.net\website\docs 30 | rd /S /Q obj 31 | DocFxBin\docfx.exe -------------------------------------------------------------------------------- /Documentation/docfx.json: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": [ 3 | { 4 | "src": [ 5 | { 6 | "src": "../src", 7 | "files": "**/*.csproj" 8 | } 9 | ], 10 | "dest": "obj/api", 11 | "properties": { 12 | "TargetFramework": "net45" 13 | } 14 | } 15 | ], 16 | "build": { 17 | "content": [ 18 | { 19 | "files": [ 20 | "api/**.yml" 21 | ], 22 | "src": "obj" 23 | }, 24 | { 25 | "files": [ 26 | "api/*.md", 27 | "articles/**.md", 28 | "toc.yml", 29 | "index.md" 30 | ], 31 | "exclude": [ 32 | "obj/**", 33 | "_site/**" 34 | ] 35 | } 36 | ], 37 | "resource": [ 38 | { 39 | "files": [ 40 | "images/**" 41 | ], 42 | "exclude": [ 43 | "obj/**", 44 | "_site/**" 45 | ] 46 | } 47 | ], 48 | "overwrite": [ 49 | { 50 | "files": [ 51 | "apispec/*.md" 52 | ], 53 | "exclude": [ 54 | "obj/**", 55 | "_site/**" 56 | ] 57 | } 58 | ], 59 | 60 | "globalMetadata": { 61 | "_gitContribute": { 62 | "branch": "dev", 63 | "apiSpecFolder": "Documentation/apispec" 64 | } 65 | }, 66 | "postProcessors": [ "ExtractSearchIndex" ], 67 | "xref": "msdn.4.5.2/content/msdn.4.5.2.zip", 68 | "dest": "..\\..\\cachemanager.net\\website\\Docs", 69 | "template": [ 70 | "default", 71 | "template" 72 | ] 73 | } 74 | } -------------------------------------------------------------------------------- /Documentation/index.md: -------------------------------------------------------------------------------- 1 | # CacheManager Api Documentation 2 | 3 | The documentation starts [here](/Documentation/api/CacheManager.Core.html) -------------------------------------------------------------------------------- /Documentation/template/ManagedReference.html.primary.tmpl: -------------------------------------------------------------------------------- 1 | {{#item}} 2 | 3 | {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}} 4 | 5 | 6 |
7 |
8 | {{^_disableBreadcrumb}} 9 | {{>partials/breadcrumb}} 10 | {{/_disableBreadcrumb}} 11 |
12 | {{#_enableSearch}} 13 |
14 | {{>partials/searchResults}} 15 |
16 | {{/_enableSearch}} 17 |