Solved

Why place EF model in seperate project

Posted on 2011-03-02
1
555 Views
Last Modified: 2012-05-11
I'm struggling to figure out how to set up my Visual Studio 2010 c# based solution.  I want to create a library to used by both a web application and windows application.  The solution will store data in a SQL Server db via Entity Framework 4.0.

It seems common practice to put the model in a seperate library but how much application logic to add to this?  For example I am downloading data from Paypal so am saving Paypal transactions in the DB.  So in my core library do I have a PaypalSystem (what I communicate with to retrieve the transactions) and put PaypalTransaction in the Model library?  It seems a muddle to me and I think I could use advice or an example!
0
Comment
Question by:canuckconsulting
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 35018689
If the database to which the EF model maps is shared by multiple applications then it would make sense to move it into a separate library. If not then I don't really see the point since the EF model maps to a particular schema, so is fairly tightly tied to the application that uses it.

Putting your PayPal stuff into it's own library might make sense. That way you make it reusable across applications and you could still make it use your existing EF model if that too was in a separate library. At least then you would have option of more easily detaching the PayPal stuff from the database if you wanted to.  
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now