You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SteveAndrews edited this page May 7, 2020
·
2 revisions
Property type should be System.Guid
public Guid UserId { get; set; }
AutoIncrement should be set to true
[PrimaryKey("UserId", AutoIncrement = true)]
You do not need to initialize the property in the constructor
//// Not necessary - this.UserId = Guid.NewGuid();
Example
[TableName("Users")]
[PrimaryKey("UserId", AutoIncrement = true)]
public class User
{
public Guid UserId { get;set; }
[Column("emailAddress")]
public string Email { get;set; }
[ResultColumn]
public string ExtraInfo { get;set; }
[Ignore]
public int Temp { get;set; }
}
Table Design
To create the column in SQL Server, ensure the following settings: