How to create a unique multi-column constraint using ServiceStack.OrmLite?

How to create a unique constraint with ServiceStack.OrmLite (using attributes, hopefully)? The documentation shows how to create a unique constraint for only one column:

ServiceStack.OrmLite Docs

If that helps, I use ServiceStack.OrmLite.SqlServer.

+3
source share
1 answer

Service Stack has a CompositeIndex attribute that accepts multiple field names. Look at the constructors here ...

CompositeIndexAttribute(params string[] fieldNames);
CompositeIndexAttribute(bool unique, params string[] fieldNames);
+4
source

All Articles