Base solution for your next web application
Open Closed

How to create a domain service - questions: #9163


User avatar
0
marble68 created
  1. If I create a domain service, do I put that class in the Application project? If not, where? Core, Core.Shared? Application.Shared?

  2. If I need this domain service to be usable by the Public website (for getting and updating entities), is that still the correct location? If not, where? Web.Core?

  3. If the public website needs to update an entity based on input from a browing user that is NOT logged in, will a simple unit of work allow that to happen?

  4. Does this unit of work need to exist in the Public controller or in the domain service?

Thanks!


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi Please refer to the domain service documentation first. : ) https://aspnetboilerplate.com/Pages/Documents/Domain-Services

  • User Avatar
    0
    marble68 created

    I have successfully accomplished this.

    For anyone looking on how:

    In Core project, next to your entity, you can create a domain service there, inheriting from workDomainServiceBase

    Then, bring that into your appservice (in Applications).

    Then, move methods required for your domain service from Applications, and have those methods call the function in the Domain service.

    This will let you put certain methods "on an island" as needed.