I'm laying out a new data layer using EF 4.1 Code First, migrating from an older homebrew data layer.
I have set up two assemblies, one for my context and one for all the POCO code first classes.
I have some business logic, for instance, a query against one table (or a few tables) that is used in several different places. Where should I put it?
It can't go in a POCO class because it joins a couple tables and so needs a context. It could go in the context, but that context would become bloated with hundreds of disorganized queries. Is there a common pattern or arrangement for all the business logic?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…