Base solution for your next web application
Open Closed

Is safe to use another application service #2628


User avatar
0
bazzer14 created

Hello, Halil.

Let's say i have CustomerAppService and ContactAppService which the Customer (Entity) has many Contact (Entity). In ContactAppService i implemented a method to check the existing contact with the name CheckIfContactExist, then i would like to check again the existing contact in CustomerAppService. And the question is how better implement the existing method call to another service? Is safe to call another application service from constructor (avoid circular dependency)? example:

CustomerAppService(IContactAppService contactAppService)

Due i use DRY principle in my project.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We don't suggest to use one app service in another. In your case you can create a IContactDomainService and use it in both app services.