Im using QBE and noticed that it ignores the identifier property - is this correct?
Obviously for an int or whatever I can use Get or Load (so it makes no sense to use QBE on a unique identifier) but if my PK is a string I might want to search for a LIKE via the EnableLike (and correct MatchMode) on the Example
Another reason I might need this is for tables with composite keys when the various properties are not exposed on the containing object (so I can can find all records that match just one of the keys that makes up the identifier)
Is it not misleading when I can write code like:
Code:
Cat cat = new Cat();
cat.Id = 1;
repository.GetByExample<Cat>(cat);
or
Code:
Cat cat = new Cat();
CatId catId = new CatId();
catId.CompositeKey1 = "some value";//search by one of the composite keys
cat.Id = catId;
repository.GetByExample<Cat>(cat);
and the result will be every cat in the database.
I now know not to use QBE for the ID and will expose the any composite key properties as properties on the parent object but I would be interested in knowing why the identifier is excluded.
many thanks
W