-
Notifications
You must be signed in to change notification settings - Fork 5
Entity Framework Repository
Michael Altmann edited this page Sep 21, 2016
·
7 revisions
This extension is a repository for CherrySeed which uses Entity Framework as O/R mapping framework.
Entity Framework Repository can be installed via NuGet.
This code block initiates an instance of EfRepository and sets this repository globally. You have to pass a delegate via constructor which creates a DbContext. For more info see Setting Global Repository and Setting Entity Specific Repository.
var efRepository = new EfRepository(() => new ApplicationDbContext());
var config = new CherrySeedConfiguration(cfg =>
{
...
cfg.WithRepository(efRepository);
...
});
- Initial version