MEF和EF - 动态模型? [英] MEF and EF - Dynamic Model?

查看:114
本文介绍了MEF和EF - 动态模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定这个问题是否属于本论坛或EF论坛。我使用EF作为我的DAL,但模型可能会在运行时更改。 EF不支持动态模型;您必须停止并重新启动应用程序以获取模型更改。

I'm not sure if this question belongs in this forum or the EF forum. I am using EF as my DAL, but the model may change during runtime. EF does not support a dynamic model; you have to stop and restart your application to pick up model changes.

但我想知道我是否以某种方式使用MEF加载模型,MEF然后会注意到模型更改时的状态通过它的重组魔术,主机应用程序获得新模型而不必停止并重新启动?

But I'm wondering if I somehow use MEF to load the model, could MEF then notice when the model changes and go through its recomposition magic such that the host application gets the new model without having to stop and restart?

我对EF非常熟悉,但对MEF来说是全新的。

I'm fairly familiar with EF, but brand new to MEF.

推荐答案

是。

查看mef.codeplex.com中的MEFShapes示例

Check out the MEFShapes example in mef.codeplex.com

DLL在运行时加载。

DLL is loaded at runtime.

 

需要注意的是,当MEF重新加载对象时,它会破坏*所有现有的实例;所以确保你的EF对象没有被使用!

Should be noted, that when MEF reloads objects, it *destroys* all existing instances; so make sure your EF objects are not in use!


这篇关于MEF和EF - 动态模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆