Hi,
I have a table like this:
PrimaryKeyID, ProjectID, TypeID, Name
1,1,1,Test1
2,1,1,Test2
3,1,2,Test1
3,1,2,Test1 <- WRONG
Now the Name column needs to be unique per TypeID for some ProjectIDs but not for others..
It seems like the best place to enforce this is in the ValidateEntityBeforeSave event.
To make sure it works the check should be within the same transaction which is saving the entity.
The problem is that no database connection is passed into ValidateEntityBeforeSave so I was wondering on how to implement it?
Thanks,
Patrick