When invoking Session.Load where the class in question contains a composite id, Load expectes the provided criteria to be an example of the object in question with all the PK properties filled in. The problem is that I want to create a generic IRepository interface with a single Load method, always providing a QBE. However, it seems that Load can not handle QBE if the PK is only a single property. Any thoughts?
A:
Have a look at the repository interfaces in the S#arp Architecture project. They expose two interfaces that allow for a standard integer id as well as another other type (eg. your composite key object) to be specified for Get
and Load
operations. This is probably the route I would take in your case.
DanP
2010-08-30 16:46:39