Entity classes decoupled from LINQ to SQL provider for implementing the Repository pattern. How?

前端 未结 9 653
不知归路
不知归路 2021-02-02 02:57

I have looked over the Repository pattern and I recognized some ideas that I was using in the past which made me feel well.

However now I would like to write an applicat

9条回答
  •  孤城傲影
    2021-02-02 03:22

    Could your Entity classes implement IProduct, IUser, IOrder etc. interfaces that would be declared in your "Interfaces" assembly? This way the IRepository interface references only the business object interfaces (i.e., returns collections of IProduct etc.) and the "Interfaces" assembly is decoupled from your other implementation-specific assemblies.

提交回复
热议问题