Hi
I am trying to create a table of AspNetAuth which is of UserRoles
I have added C# data model as follows
[Schema("dbo")]
public class AspNetUserRoles
{
[PrimaryKey]
[Required]
[References(typeof(AspNetUsers))]
public required string UserId { get; set; }
[PrimaryKey]
[Required]
[References(typeof(AspNetRoles))]
public required string RoleId { get; set; }
[Reference]
public AspNetUsers? User { get; set; }
[Reference]
public AspNetRoles? Role { get; set; }
}
Now here I am adding two primary keys because my table in database has a PRIMARY KEY CLUSTERED on it.
I read one forum question where you mentioned that its not possible in ORMLite to have multiple primary keys : Creating a composite primary key - possible?
What can I do to achieve this? As with current setup while adding tests for it I am getting error that the table has more than one primary key
Microsoft.Data.Sqlite.SqliteException : SQLite Error 1: 'table "dbo_AspNetUserRoles" has more than one primary key'.