Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8237203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:23:46+00:00 2026-06-07T19:23:46+00:00

I haven MVC app, with M including Service and Repository layers. However, I am

  • 0

I haven MVC app, with “M” including Service and Repository layers.

However, I am a little confused as to where and how to do a couple of things.

  1. One Service calling two repositories, or calling it’s own repository and another service

e.g.

I have a ReferenceDataService, which handles all of the logic for CRUD with my reference tables.

Then in my “CustomerService” I need to ‘R’ my reference data to get e.g. Description instead of Id. So, do I call the ReferenceDataService or ReferenceDataRepository?

  1. At some layer I’d like to map from Entity to ViewModel.

Do I do this in my Service layer, or in the Controller?

e.g. Does my ServiceLayer do the mapping/logic from VM to Entity and back?

Thanks:)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:23:48+00:00Added an answer on June 7, 2026 at 7:23 pm
    • Repositories talk to an underlying data source.
    • Service layer talks to repositories with domain models. It takes/passes domain models from/to the repository layer.
    • Controller talks to service layer. Controller takes/passes domain models from/to the service layer.
    • Controller calls mapping layer (if any) to map between the domain models and view models. If you don’t have a mapping layer you could do the mapping in your controller although this could quickly become cumbersome in which case AutoMapper could serve as a very handy mapping layer.

    Another more simpler scenario is when you don’t need a service layer which is often the case in smaller applications. A service layer brings no benefit. So the controller talks directly to the repositories with the domain models.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Asp.net MVC app, I have two methods on a controller, one for
I have a MVC app using the UnitOfWork, Service Layer, Repository Pattern and EF4
Our solution file contains many different projects including an ASP.NET MVC web app, a
I have built a Spring 3 MVC driven RESTful web service app. I use
I have two applications setup in IIS7.5. MVC 3 is installed. One application serves
I have an MVC app divided into the usual layers: MVC presentation layer, Business
I have an MVC app with custom membership and role providers. I am checking
I have a MVC app and using JQuery. I have anchor that I setup
I have an MVC app that does a lot of work with jQuery ajax
I have C# MVC web app that has some textboxes that in IE9 you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.