Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Plugin Interface for Models #1563

Closed
alfkonee opened this issue Feb 6, 2015 · 4 comments
Closed

Feature: Plugin Interface for Models #1563

alfkonee opened this issue Feb 6, 2015 · 4 comments

Comments

@alfkonee
Copy link

alfkonee commented Feb 6, 2015

I was just working on project that has to use a plugin architecture ie the application will have a main core with multiple plugins extending the features for the application. Each plugin will have some data models that extend the core's EF Model.
I would like to suggest a feature that will make it simple to append Model and Relationship Definitions to a current DBContext
I know this is a long shot but will really appreciate if you take it into consideration

@divega
Copy link
Contributor

divega commented Feb 6, 2015

@alfkonee Thanks for the suggestion. Could you ellaborate more on how you envision this would work?

@Jetski5822
Copy link

@alfkonee Are you talking about not knowing what models will exist in the DbContext until runtime?

Something similar to this? http://romiller.com/2012/03/26/dynamically-building-a-model-with-code-first/

@rowanmiller rowanmiller added this to the Discussions milestone Feb 11, 2015
@alfkonee
Copy link
Author

Hey there guys sorry about the long silence had a bad cold these past few days. Well the feature I suggested is exactly as shown in @Jetski5822 comment

@divega divega removed this from the Discussions milestone May 23, 2015
@divega divega removed their assignment May 23, 2015
@divega
Copy link
Contributor

divega commented May 23, 2015

I found this item sitting on my plate for investigation, but I think it either belongs in the backlog or closed, so clearing up milestone for re-triage.

The main point I gather from the conversation is to make it easy to have base models that are extended dynamically/programmatically, which is a valid and important scenario.

However, some of this is already possible, e.g. applications using ASP.NET Identity do it all the time by deriving from IdentityDbContext and overriding OnModelCreating(), etc. and customers can invoke reflection code to create an EF model as in Rowan's blog post. Although this is not necessarily as easy as it could be, lacking specifics on how to actually make it easier, I am not sure it makes sense to keep this open.

On the other hand some richer scenarios could be enabled by shadow entities which is already covered in #749.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants