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

  • Home
  • SEARCH
  • 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 6532123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:57:43+00:00 2026-05-25T09:57:43+00:00

on a ASP.NET MVC project, the data access layer is going to be implemented

  • 0

on a ASP.NET MVC project, the data access layer is going to be implemented in WCF. Reason is that these WCF services are going to be consumed by couple of other client applications in the future.

Can I know whether there are any good reference projects that I can have a look at.
Important things that I need to have a look at are:

  • How the projects are structured
  • Any best practices that need to be followed
  • How Domain objects/POCOs, DTOs, ViewModels need to be organized, and communicate between each other
  • Unit Testing approaches

All your suggestions/advices on these areas are highly appreciated

Thank you very much.

  • 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-05-25T09:57:43+00:00Added an answer on May 25, 2026 at 9:57 am

    You would do exactly the same as if you were doing any other ASP.NET MVC application. You would simply provide an implementation of your repository which would call the WCF service. So basically your repository interface could be the operation contract you got when you imported your service:

    public interface IProductsService
    {
        IEnumerable<Product> GetProducts();
    }
    

    Product and IProductsService are domain objects coming from your WCF service. In the implementation of this interface you would delegate the call to the service itself. As far as the rest of the application is concerned, your controllers doesn’t really care as they are weakly coupled:

    public class ProductsController: Controller
    {
        private readonly IProductsService _productsService;
        public ProductsController(IProductsService productsService)
        {
            _productsService = productsService;
        }
    
        public ActionResult Index()
        {
            var products = _productsService.GetProducts();
            var productsVm = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductViewModel>>(products);
            return View(productsVm);
        }
    }
    

    Pretty standard stuff and it is how your controllers should look like no matter where the data comes from. As you can see if you always design your applications with abstractions you could very easily switch implementation of this IProductsService that will be injected into your controllers and from the ASP.NET MVC application standpoint it wouldn’t even make any difference. The view models should be part of the web UI as they are strongly tied to the views.

    The service contracts and domain models go into a service layer.

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

Sidebar

Related Questions

I have an ASP.NET MVC project with xVal and data annotations and I need
I'm trying to add an ADO.NET data service to a vanilla ASP.NET-MVC project. Does
I am trying to use HTML5 data- attributes in my ASP.NET MVC 1 project.
I have an ASP.NET MVC project with a form. In the Action method that
I have an ASP.NET MVC project and I have a single action that accepts
in my asp.net MVC project i have an database connection with connectionstring: Data Source=.;Initial
I'm on a project that is being upgraded from vbscript to ASP.NET MVC. It
I have an existing ASP.Net MVC project that is using entities / repositories in
An example system might require: Presentation/administration (ASP.NET MVC site) Object model for data access,
My ASP.NET MVC site connects to a WCF service to get data. The WCF

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.