I needed to determine if a unique constraint would be violated so that I could programmatically update the Name of a business object to make it unique today. I use LLBLGen for this project’s database layer, and I have a unique constraint (actually a unique index) set on the database. In this case it covers two columns, an integer ID and a string Name, but the nice thing about LLBLGen is that it provides helper methods that generate the predicate needed. The code required looked like this:
|
|