Hi,
When I have a collection of entities I often have to validate a collection, to check for example if a specific entity with a specific value is in the collection:
Lets say I have several Service Hours, work time, travel time, etc. These serviceHours collection has a field Type. In this case Type could be Work or Time.
At several customers WorkTime is included in Warranty, but there still has to be paid for Travel Time. This means that in my collection of ServiceHours there should be at least 1 entity with the Type Travel.
Right now I just use a function to check this and loop over the collection to check if there exists a entity this type. And if so, then save the collection.
However, I know that there are EntityValidators which validates on Entity scope and automatically fires when the save function is called, you can even add this to a collection, so that when you do a SaveMulti, each entity is validated.
Is it possible to somehow create a validator for a collection, so this validatefunction is automatically fired when SaveMulti is called and in here I can place this validation logic?
If not, is it considerable to add this to the functionality of LLBLGen Pro?
Gr.,
G.I.