Multiple Primary Key

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'.

As per the referenced question, multiple primary keys is not supported in OrmLite so you would not be able to create tables using OrmLite or use any of its APIs which rely on primary keys.

But you should not be using OrmLite to modify Identity Auth tables either way. As per your previous question if you want to make changes to any Identity Auth tables you should be using .NET’s built-in classes like UserManager<T> and RoleManager<T>, etc.

Okay thanks for the help.