I made my ASP.NET MVC 5 project modular(pluggable) with MEF
In my website users come and can install new plugins, delete them or update them
I don't know what to do with my data access layer(I mean where should my models place)?
if I create a new project for my models every time a user install/delete/update a plugin that project show update and it's not good because dll is running,
what can I do?
please help me
Add a comment
|
1 Answer
Instead of have one class for one entity you can have for example 3 classes for all:
Type (Id, Name) Property (TypeId, DataTypeId, Value) PropertyValue (PropertyId, Value)
It's very flexibly approach but less fast because of number of tables and queries.
Added:
So when your customer want to add plugin you just crate new Type, add it's properties and their values.
9 Comments
user3091222
the users add plugins run time, really I didn't get what you mean
Dmitry Sikorsky
ok, what is plugin in our case? if it is 'real' C# type that is derived from some your base type (or implements some interface) and it's located in assembly, you can load this assembly into memory and use that type with EF 'code first' approach.
user3091222
my plugins are class library projects that become al part of the main website,
Dmitry Sikorsky
I still can't understand what is the problem. can you describe it more clear? Where users of your website get plugins? They make them? Do the have access to source code or they upload plugins via http?..
user3091222
I'm creating something like a CMS, It's an online shop, Then the project is finished I want to upload it and Users can come and register and use it with different plugins(for example a plugin that shows product sales in a chart), it's like (www.prestashop.com), now I want to know what to do with my models, because the models and contexts will be repeated if each module has its own models and context, so if I can't explain it clear, Thanks for answering
|