English 中文(简体)
Plement WPF MVVM and ADO. 实体框架
原标题:Putting WPF MVVM and ADO.Net Entity Framework
  • 时间:2012-05-16 14:57:33
  •  标签:
  • wpf
  • mvvm

I am trying to create a WPF project with MVVM and ADO.Net Entity Framework. I do have a few questions though.

  1. Do i create the Entity Framework Model in the Model Folder of the MVVM Design?
  2. Or do i have to create a new project for each item of the MVVM Model(i.e Views Project as a WPF Project,Model Project as a class libraray, ViewModel project as a class library)?
最佳回答

确实,如果你打脚,那就是一个问题,但我通常把我所有的EF或Linq-Sql放在一个模型夹中,因为他们通常会把我的所有模式都放在一边,并且把它放在一起。 这是一种灰色区域,因为它也使数据管理员 st,因此也铭记了这一点。

关于您的第二点,第2点。 模式、观点和看法都应在同一项目中。

查阅this,以便获得关于多国企业社会责任的某些指导。

问题回答

是否在多国机器设计书的《示范法》中建立实体框架模型?

我通常为储存不知(使用POCOs)以及使用不知情者的模式建立一个单独的项目。

或者,我不得不为多国企业模式的每一项目(即:)设立一个新的项目。 作为WPF项目的意见项目,Model项目作为一组图书馆,GisModel项目作为一个班级图书馆?

如果你计划采用一种以上的模式(如:为计生联,为一项服务,为另一项服务),则将你的视力模型单独组合。

If your views only represent one model layer, then you can start out your views and view-models in the same assembly, then separate them if you get to a situation that you have multiple models under the same view (each with its own view-model).


您还应考虑您是否希望《反歧视法》。 NET的模型是你的主要模式(根据你的看法模型),或者如果你想把它作为储存的一种观点模型对待(储存服务是一种观点)。





相关问题
WPF convert 2d mouse click into 3d space

I have several geometry meshes in my Viewport3D, these have bounds of (w:1800, h:500, d:25). When a user clicks in the middle of the mesh, I want the Point3D of (900, 500, 25)... How can I achieve ...

Editing a xaml icons or images

Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...

WPF: writing smoke tests using ViewModels

I am considering to write smoke tests for our WPF application. The question that I am faced is: should we use UI automation( or some other technology that creates a UI script), or is it good enough to ...

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

How do WPF Markup Extensions raise compile errors?

Certain markup extensions raise compile errors. For example StaticExtension (x:Static) raises a compile error if the referenced class cannot be found. Anyone know the mechanism for this? Is it baked ...

WPF design-time context menu

I am trying to create a custom wpf control, I m wondering how I can add some design-time features. I ve googled and can t seem to get to my goal. So here s my simple question, how can I add an entry ...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签