문제

I am writing a small application in WPF. It allows me to save and read data from db. It has 3 tiers (Business logic, Presentation layer, and Data Access). I use database-first approach and Entity Framework has generated a model for me.

My question is where I should store my .edmx generated model?

If I put it in the Data Access I will need to write some duplicate code in my Business logic, and if I put this model in the Business Logic then what should I store in the Data Access tier?

도움이 되었습니까?

해결책

The Entity Framework model most logically belongs in the data access layer, I believe. I've typically used a Data Service wrapper on top of EF, then you can initiate your transactions, perform business logic validation, etc. at or above that layer. Some additional info on this here.

There is an interesting slide on EF and the data access layer here.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top