0

I'm planning to create a web application using MVC 4 Single page application and I will use database first approach. And I'm using the default Sql Server LocalDB (with the login/authentication tables).

Where should I put the edmx file? Under the Model folder? What if I want to have a service layer/repository layer.

BTW, the default template of SPA create two classes for each model, for example TodoList.cs and TodoListDto.cs. Why and is there any better design to avoid two classes?

1 Answer 1

2

I like to start by creating a {DataLayer}-Project.

  1. Add the EDMX file to your {DataLayer}-Project
  2. Add a references (under references) from your main project to your {DataLayer}-Project
  3. add using {DataLayer}-Project; in every file that makes reference to your Entities

When my project achieves optimum maturity, I change my {DataLayer}-Project into a service.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm using SQL localDb with login/authentication tables. Can I move these tables to localDB of the class library project too?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.