Skip to content

Generate a repository in seconds by simply providing a namespace to your entities

License

Notifications You must be signed in to change notification settings

OmarElabd/RepositoryGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Repository Generator

Repository Generator will generate an entire repository structure for you. All you need to supply a namespace which contains all your Entity Framework models and the RepositoryGenerator.tt will generate repositories for all your models, it will generate a generic repository providing you with basic functionality out of the box. A Unit of Work class will also be generated.

Usage

Modify the RepositoryGenerator.tt file, replace the line:

string targetNamespace = "(ENTER THE FULL NAMESPACE TO YOUR MODELS)";

with your the fully qualified namespace to your entity framework models. If your DbContext class is not in this namespace please also modify this line:

string efContext = "DefaultModel";

replace DefaultModel with the name of the class that implements the DbContext class.

Extending the Repository

All your repositories will inherit from Repository which contains generic methods, feel free to override any methods. To add new repository methods, please add them to the I(ClassName)Repository interface and implement them in the (ClassName)Repository.

About

Generate a repository in seconds by simply providing a namespace to your entities

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published