Insert UUID #123
Insert UUID
#123
Replies: 1 comment
-
By default If you're going to be inserting the primary key (as you would in your join table) you should just specify [Table("users_groups")]
public class UserGroup : BaseModel
{
[PrimaryKey("user_id", shouldInsert: true)]
public string UserId { get; set; }
[PrimaryKey("group_id", shouldInsert: true)]
public int GroupId { get; set; }
[Column("is_owner")]
public bool IsOwner { get; set; }
[Column("nickname")]
public string Nickname { get; set; }
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So, I have those tables in my database

and Classes in C#
But when I try to insert new row in "users_groups" this way:
I'm getting this error
Also, user_id is not null in C#

Beta Was this translation helpful? Give feedback.
All reactions