{"id":19990866,"url":"https://github.com/moozzyk/EFCache","last_synced_at":"2025-05-04T10:30:48.676Z","repository":{"id":60773407,"uuid":"74301774","full_name":"moozzyk/EFCache","owner":"moozzyk","description":"Second Level Cache for Entity Framework 6.1","archived":false,"fork":false,"pushed_at":"2023-11-27T00:45:18.000Z","size":146,"stargazers_count":101,"open_issues_count":7,"forks_count":22,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-19T03:10:30.732Z","etag":null,"topics":["c-sharp","caching","entity-framework","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"ms-pl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moozzyk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-20T20:52:30.000Z","updated_at":"2025-01-05T14:12:16.000Z","dependencies_parsed_at":"2022-10-04T15:25:15.672Z","dependency_job_id":"e99a6231-696b-4128-8d42-b6c3bc5ab57e","html_url":"https://github.com/moozzyk/EFCache","commit_stats":{"total_commits":75,"total_committers":9,"mean_commits":8.333333333333334,"dds":"0.21333333333333337","last_synced_commit":"05be3befd713c59a362377ae820621756893559c"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moozzyk%2FEFCache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moozzyk%2FEFCache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moozzyk%2FEFCache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moozzyk%2FEFCache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moozzyk","download_url":"https://codeload.github.com/moozzyk/EFCache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252319994,"owners_count":21729055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","caching","entity-framework","hacktoberfest"],"created_at":"2024-11-13T04:51:30.582Z","updated_at":"2025-05-04T10:30:47.954Z","avatar_url":"https://github.com/moozzyk.png","language":"C#","funding_links":[],"categories":["Supported Packages","C\\#"],"sub_categories":[],"readme":"# Second Level Cache for Entity Framework 6.1+\n\nEntity Framework does not currently support caching of query results. A sample EF Caching provider is available for Entity Framework version 5 and earlier but due to changes to the provider model this sample provider does not work with Entity Framework 6 and newer. This project is filling the gap by enabling caching of query results for Entity Framework 6.1+ applications. \n\n#### This project was moved from https://efcache.codeplex.com\n\nYou may still find some useful information there:\n\n - Old discussion board - https://efcache.codeplex.com/discussions\n - Issues - https://efcache.codeplex.com/workitem/list/basic\n\n# How to get it\n\nYou can get it from NuGet - just install the [EntityFramework.Cache NuGet package](http://www.nuget.org/packages/EntityFramework.Cache)\n\n# How to use it\n\nThe project uses a combination of a wrapping provider and a transaction interceptor. A simple [InMemoryCache](https://github.com/moozzyk/EFCache/blob/master/src/EFCache/InMemoryCache.cs) is included in the project. To use it you need first configure EF using code based configuration. Here is an example of how such a configuration looks like.\n\n```C#\npublic class Configuration : DbConfiguration\n{\n  public Configuration()\n  {\n    var transactionHandler = new CacheTransactionHandler(new InMemoryCache());\n\n    AddInterceptor(transactionHandler);\n\n    var cachingPolicy = new CachingPolicy();\n\n    Loaded +=\n      (sender, args) =\u003e args.ReplaceService\u003cDbProviderServices\u003e(\n        (s, _) =\u003e new CachingProviderServices(s, transactionHandler, \n          cachingPolicy));\n  }\n}\n```\n\nStarting with version 1.1.1 you can also use the new static `EntityFrameworkCache.Initialize()` method to configure EF to use EFCache. The `Initialize` method should be invoked at app startup (before EF is used) - e.g. in the application static constructor. To initialize EFCache with the built-in [InMemoryCache](https://github.com/moozzyk/EFCache/blob/master/src/EFCache/InMemoryCache.cs) you can use the following code:\n\n```C#\nEntityFrameworkCache.Initialize(new InMemoryCache());\n```\n\nYou can find more details in my [blogpost](http://blog.3d-logic.com/2014/03/20/second-level-cache-for-ef-6-1/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoozzyk%2FEFCache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoozzyk%2FEFCache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoozzyk%2FEFCache/lists"}