I have a model with composite key - the row is the key:
public class Item { [Key, Column(Order = 0)] public int UserId { get; set; } [Key, Column
It's not possible with Sql Server, or Oracle for any part of a primary key.
But you can have a unique constraint on these datas.
Which means you can have one time
UserId = 2, Date = null
Then
UserId = 2, Date =
You can't create directly unique constraints with Code First, but look at SMO.