Raheel Khan
Raheel Khan

Reputation: 14787

Using Entity Framework classes without database connection

I have a strange situation. I have created a data model visually and generated a database from it. This project is referenced by two projects:

The ASP .NET application deals directly with the database while I need the WinForms application to interact with the database via the Web application.

I have created a page called API.aspx and use HTTP POST to send values and get results in XML.

However, since the WinForms application still needs to use the data model classes, I am running into issues using them without creating a database object.

What is a good strategy to use in this scenario?

Upvotes: 4

Views: 2963

Answers (2)

Brian Mains
Brian Mains

Reputation: 50728

This sounds like a candidate for an SOA implementation, rather than having the windows forms app communicate directly with the web application:

Upvotes: 0

Justin Pihony
Justin Pihony

Reputation: 67065

If you have implemented your code with loose coupling (See the Repository Pattern), then you could create a database stub that will return dummy data (or in memory data) until you are ready to plug in the actual EF framework.

This is generally good practice to create a clean separation of concerns.

Upvotes: 2

Related Questions