What is the optimal way to write the code which interacts with DB using linq2SQL? I need to add some business logic to the entities. So I guess there are two ways:
- Write some wrapper class. The
main minus is that many fields are
the same, so i don’t feel it as DRY
style. - Add business logic methods
to linq2sql entities(these classes
are partial) directly - ???
I’d suggest the biggest benefit of them being generated as partial classes, is that you can extend functionality without the risk of it being stomped by code generation tools (i.e. if the DB schema changes)