?
Solved

Why place EF model in seperate project

Posted on 2011-03-02
1
Medium Priority
?
562 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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