Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Table("Merchant")]
- public class Merchant
- {
- [Key, Column(Order = 0)]
- public long MerchentId { get; set; }
- [Column("MerchantName", TypeName = "nvarchar"),MaxLength(100)]
- public string MerchantName { get; set; }
- public virtual Prediction Prediction { get; set; }
- }
- [Table("Prediction")]
- public class Prediction
- {
- [Column(Order = 0), Key]
- public long MerchentId { get; set; }
- [Column("TxnDate", TypeName = "datetime", Order = 1), Key]
- public DateTime TxnDate { get; set; }
- public long TxnCount { get; set; }
- public long PredictionCount { get; set; }
- public virtual ICollection<Merchant> Merchants { get; set; }
- }
- modelBuilder.Entity<Merchant>().HasRequired<Prediction>(x => x.Prediction).WithMany(x => x.Merchants).HasForeignKey(x => x.MerchentId).WillCascadeOnDelete(false);
- 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'.
- 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