I have an entity:
Item{
Id,
Barcode,
UnitBarcode
}
I wand both columns 'Barcode' and 'UnitBarcode' be unique, that there are no equal'UnitBarcode' and 'Barcode' in any rows, like this table below:
Id | Barcode | UnitBarcode | status |
---|---|---|---|
1 | 123 | 1234 | allowed |
2 | 1234 | 5687 | not allowed |
3 | 5896 | 123 | not allowed |
4 | 123 | 798965 | not allowed |
Is there a way to implement this in EF Core 5.0 with Sql Server?