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 8542409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:03:38+00:00 2026-06-11T12:03:38+00:00

I’m getting started with domain driven design in asp.net mvc with c# and have

  • 0

I’m getting started with domain driven design in asp.net mvc with c# and have a small sample project I am creating. I currently have a project for my domain layer, service layer, web, and also a console application. I am also using mongodb as my database.

Currently my project has groups with people belonging to those groups which I have a class called Group and Person in my domain layer something like below (simplified). Group and Person also represent what the collection Group looks like in my mongodb database.

public class Group
{
   public string Name { get; set; }
   public List<Person> People { get; set; }
}

public class Person
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
}

The way I understand it is my website and my console application should be communicating to my services layer which acts as a sort of facade and should never see the domain layer?

The thing I am unsure of is in my console application or website if I wanted to ask the service layer for all the groups normally I would expect that I would be asking for something like

var groupService = new GroupService();
List<Group> groups =  groupService.GetGroups();

Except in this instance as my group, and person classes are in the domain layer which my console app and website have no idea about I can’t ask for a list of Group as my application has no idea what a Group is.

Should my service layer be outputting the result as something else such as Json where it is up to my website and console app or say if I had an api that others could access to work out what to do with this data? or have I got something mixed up here?

EDIT:

In the future I plan to use my service and domain in an android app. I am thinking of using a restful service. I don’t plan (at this stage) to have this as a public API.

  • 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-11T12:03:39+00:00Added an answer on June 11, 2026 at 12:03 pm

    Your service layer will be communicating with data transfer objects, not domain objects. The difference between a domain entity and a data transfer object is that domain entities have behavior and data transfer objects (DTO) are just data.

    So, to answer your question: Your service layer will take commands and queries from your console application or your website using data transfer objects and translate them into domain entities. It will get results from the domain entities and translate the results back into DTOs.

    It might be very possible that a single domain entity doesn’t translate into a DTO at all, or that a single domain entity translates into 10 DTOs. These are 2 very different apis used for 2 very different purposes. My suggestion is to develop your domain layer and then build your service layer on top to enable communication based on the needs of the clients (console and web app).

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have an array which has BIG numbers and small numbers in it. I
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.