Print Page | Close Window

Reusing Domain Model in another app

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2558
Printed Date: 31-Mar-2025 at 1:04am


Topic: Reusing Domain Model in another app
Posted By: BillG
Subject: Reusing Domain Model in another app
Date Posted: 14-Mar-2011 at 12:51pm
I am creating a WPF version of my Silverlight app. Is there an easy way to just move the Domain Model over to the new. Nothing changes. Can I just copy the directory over to my app and insert existing items or do I have to recreate it?
 
Bill
 



Replies:
Posted By: smi-mark
Date Posted: 14-Mar-2011 at 5:21pm
Hi Bill,

Just use the domain model you are using in the web project. If your edmx is currently in the web project, and not in it's own separate class library, then you will want to split it out.

This is how I typically structure it:

MyProjectWeb
MyProject.Model.Desktop (Project Namespace MyProject.Model)
MyProject.Model.SL (Project Namespace MyProject.Model)
MyProject (SL App)

The web has a reference to MyProject.Model.Desktop and the SL has a reference to MyProject.Model.SL.

In your WPF application, you can now simply add a reference to MyProject.Model.Desktop and you are done.



Print Page | Close Window