Otis wrote:
mshe wrote:
Hi all,
Is there a possiblity of adding a "Find By PK" function for an EntityCollection? Or Perhaps the EntityCollection.Item property could be indexed by PK as well?
What if the PK contains 3 fields?
the problem is that in adapter code, this is difficult, because the EntityCollection is a generic collection class, and therefore FindByPk will then become a complex method which wont be that simpler than setting up a simple predicate with FindMatches.
How about an array parameter field like:
EntityCollection.Find(new object() {PK1, PK2, PK3, PK4, etc})?
OR
EntityCollection.Find(new object() {new SomeLLBLGenObject("PK1", value), new SomeLLBLGenObject("PK2", value)})
Just an idea - I think it's just personal preference... also because I believe the Adapter class has a "FetchUnique" function. I just find the FindMatches function a bit unintuitive to use to fetch unique rows (i.e. some of my entity collections are hashtable like - I use them to store parameters for an associated Entity - like MyEntity.ParameterCollection).