Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. [Key, Column(Order=1)] // composite key with ExternalId. WebshopId+ExternalId must be unique
  2. [ForeignKey("Webshop_Id")]
  3. public virtual Webshop WebshopEntity
  4. {
  5. get { return _Webshop; }
  6. set { _Webshop = value; }
  7. }
  8.  
  9. [NotMapped]
  10. private Webshop _Webshop;
  11.  
  12. public int Webshop_Id { get; set; }
  13.  
  14. [Key, Column(Order = 2)]
  15. [MinLength(1, ErrorMessage = "ExternalId must be atleast 1 character")]
  16. public virtual string ExternalId { get; set; }
  17.  
  18. {"Violation of PRIMARY KEY constraint 'PK_dbo.Products'. Cannot insert duplicate key in object 'dbo.Products'. The duplicate key value is (110).rnThe statement has been terminated."}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement