Help! MVC app with Entity Framework.

Hi all,

I've been set a task to create a database of customers and display them on a single web page, using a Business Logic class library, a data class library (using EF) and a web project. The web project must call the business logic and in turn that must call the data logic and the view must display it.

I started out and all was fine – I have very little MVC experience and even less EF, but I broke it down and learned a little about EF first in WinForms (quick and easy) and all was fine.

I now use the the MVC 'wizard' thing, and I have the controller and view, and connected to the DB using the connection wizard which in turn created a couple of classes, but there is no data showing at all. If I use the 'create' view and type a new customer in, it displays…it seems to have replicated the data structure locally to store and display.

How can I force it to load the data from the database?

EDIT: Found where it was…it was ApplicationDbContext referencing "DefaultConnection".

However, that is all one project. How would I split it up into the above architecture?

by dchurch244 via /r/csharp

Leave a Reply