Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. [Table("Merchant")]
  2. public class Merchant
  3. {
  4. [Key, Column(Order = 0)]
  5. public long MerchentId { get; set; }
  6. [Column("MerchantName", TypeName = "nvarchar"),MaxLength(100)]
  7. public string MerchantName { get; set; }
  8. public virtual Prediction Prediction { get; set; }
  9. }
  10.  
  11. [Table("Prediction")]
  12. public class Prediction
  13. {
  14. [Column(Order = 0), Key]
  15. public long MerchentId { get; set; }
  16. [Column("TxnDate", TypeName = "datetime", Order = 1), Key]
  17. public DateTime TxnDate { get; set; }
  18. public long TxnCount { get; set; }
  19. public long PredictionCount { get; set; }
  20. public virtual ICollection<Merchant> Merchants { get; set; }
  21. }
  22.  
  23. modelBuilder.Entity<Merchant>().HasRequired<Prediction>(x => x.Prediction).WithMany(x => x.Merchants).HasForeignKey(x => x.MerchentId).WillCascadeOnDelete(false);
  24.  
  25. Merchant_Prediction_Source: : Multiplicity is not valid in Role 'Merchant_Prediction_Source' in relationship 'Merchant_Prediction'. Because the Dependent Role refers to the key properties, the upper bound of the multiplicity of the Dependent Role must be '1'.
  26. Merchant_Prediction_Target_Merchant_Prediction_Source: : The number of properties in the Dependent and Principal Roles in a relationship constraint must be identical.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement