This .NET Global tool is a supplemental tool for generating EFCore Repository Pattern.
dotnet tool install -g Duotify.EFCore.EFRepositoryGenerator-
Usage information
efr
efris stands for Entity Framework Repository Pattern generator. -
List all the DbContext class in the project
efr list
-
Generating all the repositories for the entity model.
efr generate -c ContosoUniversityContext -o Models
This command will build existing project first. Only buildable project can generate.
Show generating files
efr generate -c ContosoUniversityContext -o Models -v
Overwrite existing files
efr generate -c ContosoUniversityContext -o Models -v -f
-
Change
<PackageVersion>and<Version>property in*.csprojfile -
Build & Pack & Publish
dotnet pack -c Release dotnet nuget push bin/Release/Duotify.EFCore.EFRepositoryGenerator.1.0.0.nupkg --api-key YourApiKeyFromNuGetOrg --source https://api.nuget.org/v3/index.json