Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
Is it possible to create combined primary keys with PetaPoco?
[TableName("slVisitors")] [PrimaryKey("EventId,MemberId", autoIncrement=false)] [ExplicitColumns] [DataContract(Name = "visitor", Namespace = "")] public class Visitor { [Column("EventId")] [PrimaryKeyColumn(AutoIncrement = false, Clustered = true)] [DataMember(Name = "eventid")] public int EventId { get; set; } [Column("MemberId")] [PrimaryKeyColumn(AutoIncrement = false, Clustered = true)] [DataMember(Name = "memberid")] public int MemberId { get; set; } }
This only creates a primary key for the first column. Thanks!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Combined primary keys with petapoco
Hello,
Is it possible to create combined primary keys with PetaPoco?
This only creates a primary key for the first column. Thanks!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.