Index with Null values

Mar 11, 2015 at 6:49 PM
Is it possible with VITA to have a unique constraint with NULL values?

ex:
CREATE UNIQUE NONCLUSTERED INDEX idx_yourcolumn_notnull
ON YourTable(yourcolumn)
WHERE yourcolumn IS NOT NULL;

Regards
Coordinator
Mar 11, 2015 at 6:59 PM
yes, you should specify Filter property in Index attribute
in Book sample, there's commented out property on IBook entity:
[Nullable, Size(40), Unique(Filter = "{Isbn} IS NOT NULL")]
string Isbn { get; set; }
uncomment it, and see index appear in database.
Mar 11, 2015 at 7:02 PM
Very nice.

Must be the only ORM that can do this :)

Impressive Job with VITA.
Coordinator
Mar 11, 2015 at 7:24 PM
thanks... a lot of things in VITA are unique, that no other system does. And many are not as trivial as this one :)