jasontaylordev / NorthwindTraders

Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In my case all entities should implement an interface, but domain doesn't have access to interfaces, what should I do?

dehghani-mehdi opened this issue · comments

Hi,

I saw your video about clean architecture, very nice job.

You mentioned all interfaces should be in Application layer and all entities in Domain layer, but I need all my entities inherit form IEntity interfaces, e.g:

public interface IEntity { } // in my case it's just marker interface

What should I do?

p.s: I'm not here to discuss marker interfaces.

What kind of interface is it?

@hypervtechnics Just updated the first post

You may put those in the domain layer. Not ALL (literally) interfaces should be in application layer. Only those which represent a component/service your application depends on. The interfaces are implemented in the infrastructure layer. See here for more information: https://github.com/JasonGT/CleanArchitecture/blob/master/README.md#application

Thank you, I think having 2 places to put interfaces is not ideal solution.

These interfaces have different contexts, therefore two different locations are justifiable