RKh
RKh

Reputation: 14159

Queries on Repository Layer in MVC application

I am building MVC 5 application using Razor.

My application is layered as below:

  1. UI Layer: Comprising of Model, View and Controller.
  2. Data Access Layer: Connection and Stored Procedure classes
  3. Business Layer (Service Layer)
  4. Repository

I referred to Contosso Sample Application. There it is using DAL to store Repository. But I am creating a separate layer.

I want to know:

  1. Whether to keep Repository as a separate layer or in DAL?
  2. UI layer Model holds View Models. Where does other models go? Do they reside in Repository Layer? Are these called POCO?

Upvotes: 2

Views: 218

Answers (1)

Mathew Thompson
Mathew Thompson

Reputation: 56449

  1. Usually, the Repository is the method of accessing the data and is therefore just an implementation technique of the DAL. I'd combine them both as the DAL.
  2. In terms of other models, I assume you mean the classes that correspond with your data items. These should also live in the DAL/Repository layer. They are referred to as POCOs as they don't contain any implementation, simply a list of properties (plain old CLR object).

Upvotes: 2

Related Questions