IdentityServer / IdentityServer3.EntityFramework

EntityFramework persistence layer for IdentityServer3
Apache License 2.0
68 stars 97 forks source link

3 db contexts #70

Closed skivsoft closed 8 years ago

skivsoft commented 9 years ago

Hello,

May I ask is there any reason to use three different db contexts instead of one?

skivsoft commented 9 years ago

I would like to use IdSrv.EF in my project, and also I would like to keep it maintainable for future changes in IdSrv. So I inherits each of these 3 db contexts and create manual EF migrations in my derived db contexts.

In this case after any future changes in IdServ's entites I shoud execute Add-Migration for all three db contexts in my project. For me is better to have only one db context.

Could I propose PR to do something like already done here DbContextUserAccountRepository.cs to cover my case? or even maybe create an interfaces for the db contexts and pass through the interfaces to ClientStore's constructor instead of passing through concrete db context?

brockallen commented 9 years ago

Because not everyone needs or wants all three.

skivsoft commented 9 years ago

Could it be changed in the same way as in MembershipReboot.Ef using repositories and extensions for DBModelBuilder?

brockallen commented 9 years ago

What specifically did you have in mind?

skivsoft commented 9 years ago

It would be nice to have an option to use it in one context without changing 3 db contexts by default.

brockallen commented 9 years ago

Well, if you can prototype an approach that allows both, then we're open to PRs.

skivsoft commented 9 years ago

What do you think about PR #71 is it okay?

brockallen commented 8 years ago

Ok, I took a look and it seems fine -- I suppose you're doing your own single DbContext in your own code somewhere?

brockallen commented 8 years ago

Ok, I merged the PR. Thanks.