{"repo":"apache/casbin-efcore-adapter","free":true,"listed":false,"github":"https://github.com/apache/casbin-efcore-adapter","clone":"git clone https://github.com/apache/casbin-efcore-adapter.git","description":"Entity Framework Core Adapter for Casbin.NET","language":"C#","stars":60,"topics":["casbin","adapter","ef","entityframeworkcore","entity-framework","orm","access-control","authz","authorization"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"EF Core Adapter EF Core Adapter is the EF Core adapter for Casbin. With this library, Casbin can load policy from EF Core supported database or save policy to it. The current version supported all databases which EF Core supported, there is a part list: - SQL Server 2012 onwards - SQLite 3.7 onwards - Azure Cosmos DB SQL API - PostgreSQL - MySQL, MariaDB - Oracle DB - Db2, Informix - And more... You can see all the list at Database Providers. Installation Supported Frameworks The adapter supports the following .NET target frameworks: - .NET 9.0 - .NET 8.0 - .NET 7.0 - .NET 6.0 - .NET 5.0 - .NET Core 3.1 Simple Example Using with Dependency Injection When using the adapter with dependency injection (e.g., in ASP.NET Core), you should use the IServiceProvider constructor or the extension method to avoid issues with disposed DbContext instances. Recommended Approach (Using Extension Method) Alternative Approach (Using IServiceProvider Constructor) This approach resolves the DbContext from the service provider on each database operation, ensuring that: - The adapter works correctly with scoped DbContext instances - No ObjectDisposedException is thrown when the adapter outlives the scope that created it - The adapter can be used in long-lived services like singletons Multi-Context Support The adapter supports storing different policy types in separate database contexts, allowing you to: - Store policies (p, p2, etc.) and groupings (g, g2, etc.) in different schemas and/or tables -","default_branch":null,"files":null,"tree":[],"storefront":"/r/apache","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/apache/casbin-efcore-adapter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}