DotOrgProjects.EntityPlatform.Finder
1.0.1
dotnet add package DotOrgProjects.EntityPlatform.Finder --version 1.0.1
NuGet\Install-Package DotOrgProjects.EntityPlatform.Finder -Version 1.0.1
<PackageReference Include="DotOrgProjects.EntityPlatform.Finder" Version="1.0.1" />
<PackageVersion Include="DotOrgProjects.EntityPlatform.Finder" Version="1.0.1" />
<PackageReference Include="DotOrgProjects.EntityPlatform.Finder" />
paket add DotOrgProjects.EntityPlatform.Finder --version 1.0.1
#r "nuget: DotOrgProjects.EntityPlatform.Finder, 1.0.1"
#:package DotOrgProjects.EntityPlatform.Finder@1.0.1
#addin nuget:?package=DotOrgProjects.EntityPlatform.Finder&version=1.0.1
#tool nuget:?package=DotOrgProjects.EntityPlatform.Finder&version=1.0.1
EP Finder — Entity Platform Finder
EP Finder is a module of the Entity Platform (EP) team of .ORG Projects, designed to eliminate the need to manually declare DbContext and its DbSet<T> properties in applications that use Entity Framework Core.
EP Finder scans an assembly and root namespace looking for classes annotated with the [Table] data attribute and registers them automatically in EF Core by replacing its internal IDbSetFinder service.
Note: EP Finder only works with entities configured via Data Attributes. Fluent API is not supported and there are no plans to support it.
Help
Full Help is available at EP Finder Help.
Installation
dotnet add package DotOrgProjects.EntityPlatform.Finder
Usage
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using DotOrgProjects.EntityPlatform.Finder;
namespace MyApp {
class Program {
static void Main(string[] args) {
ServiceCollection services = new ServiceCollection();
services.AddDbContext<DbFoundContext>(options => {
options.UseSqlServer(DbSettings.GetDataSource());
options.UseFinderIn("MyApp.Assembly", "MyApp.Entities.Root.Namespace");
});
ServiceProvider provider = services.BuildServiceProvider();
DbFoundContext context = provider.GetRequiredService<DbFoundContext>();
context.Database.EnsureCreated();
List<Product> products = context.Set<Product>().ToList();
}
}
}
The developer uses DbFoundContext from EP Finder to register the context — the rest of the internal classes are never referenced directly.
How It Works
DbSetFinder replaces EF Core's internal IDbSetFinder via ReplaceService<IDbSetFinder, DbSetFinder>(). Instead of looking for DbSet<T> properties declared in the DbContext, it scans the assembly and root namespace configured in DbFinderContextOptionsExtension looking for classes annotated with [Table] and registers them as model entities.
EF Core guarantees that OnConfiguring always runs regardless of how the DbFoundContext instance is created, so DbSetFinder is always correctly registered.
Warning:
IDbSetFinderis an internal EF Core API subject to changes between versions without prior notice. It has not changed between EF Core 8, 9, and 10.
Migrations
EF Core discovers DbFoundContext at design time through DI — when running the app startup it finds DbFoundContext registered with AddDbContext<DbFoundContext>() and uses it to generate migrations. No additional design time class is required.
License
EP Finder is licensed under the Microsoft Public License (Ms-PL).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.