0

Problem when saving data:

An entity object can not be referenced by multiple instances of IEntityChangeTracker

Code:

public class Transactions
{
    [Key]
    public long Id { get; set; }
    public string Url { set; get; }
    public bool? Showsender { get; set; }
    public virtual PaymentStatus PaymentStatusItem { get; set; }
    public string Trackingnumber { set; get; }
    public DateTime? Executiondatetime { set; get; }
    public virtual Account SourceAccount { set; get; }
    public virtual Account DestinationAccount { set; get; }
    public Decimal? Amount { set; get; }
    public string Currency { set; get; }
    public string Type { set; get; }
    public string Status { set; get; }
    public string Description { set; get; }
    public decimal? CurrentBalance { get; set; }
    public decimal? Balance { get; set; }
    public virtual TransactionType TransactionTypeItem { get; set; }
    public virtual  Account DestinationAccountItem { get; set; }
    public virtual Account SourceAccountItem { get; set; }
}

I tried but I couldn't find a solution to this problem.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • This might help you https://stackoverflow.com/questions/10191734/entity-object-cannot-be-referenced-by-multiple-instances-of-ientitychangetracker" – Test12345 Sep 27 '19 at 07:07
  • 1
    Possible duplicate of [entity object cannot be referenced by multiple instances of IEntityChangeTracker. while adding related objects to entity in Entity Framework 4.1](https://stackoverflow.com/questions/10191734/entity-object-cannot-be-referenced-by-multiple-instances-of-ientitychangetracker) – Dale K Sep 27 '19 at 07:08
  • sometimes this happens when you are creating data when you should be updating it. – alikuli Oct 22 '19 at 15:59

0 Answers0