I have a value object named Validity and its attribute StartDate and EndDate.
I have Update this field.but getting some error.The error is:

InvalidOperationException: The entity type 'Validity' has a defining navigation and the supplied entity is currently not being tracked. To start tracking this entity call '.Reference().TargetEntry' on the owner entry.

How to solve this error?

My Code Is:

```cs
public async Task<Subscription> Update(string ID, bool Active, string Plan, string Periodicity, decimal Price, string LocationTargets, string paymentStatus,
            DateTime startDate, DateTime endDate, string OperationType)
        {
            #region PaymentStatus
            int EnumPaymentStatus = 0;
            string[] values = Enum.GetNames(typeof(PaymentStatusEnum.PaymentStatus));

            if (values[0] == paymentStatus)
            {
                EnumPaymentStatus = (int)PaymentStatus.Due;
            }
            else if (values[1] == paymentStatus)
            {
                EnumPaymentStatus = (int)PaymentStatus.Open;
            }
            else if (values[2] == paymentStatus)
            {
                EnumPaymentStatus = (int)PaymentStatus.UnPaid;
            }
            else if (values[3] == paymentStatus)
            {
                EnumPaymentStatus = (int)PaymentStatus.Paid;
            }
            #endregion

            #region Periodicity
            int EnumPeriodicityValue = 0;
            string[] values1 = Enum.GetNames(typeof(PeriodicityEnum.EnumPeriodicity));

            if (values1[0] == Periodicity)
            {
                EnumPeriodicityValue = (int)EnumPeriodicity.Monthly;
            }
            else if (values1[1] == Periodicity)
            {
                EnumPeriodicityValue = (int)EnumPeriodicity.Trimestral;
            }
            else if (values1[2] == Periodicity)
            {
                EnumPeriodicityValue = (int)EnumPeriodicity.Semestral;
            }
            else if (values1[3] == Periodicity)
            {
                EnumPeriodicityValue = (int)EnumPeriodicity.Annual;
            }
            #endregion

            #region Operation Type
            int OperationTypeValue = 0;
            string[] values2 = Enum.GetNames(typeof(OperationTypeEnum.EnumOperationType));

            if (values2[0] == OperationType)
            {
                OperationTypeValue = (int)EnumOperationType.NewSubscription;
            }
            else if (values2[1] == OperationType)
            {
                OperationTypeValue = (int)EnumOperationType.SubscriptionRenewal;
            }
            else if (values2[2] == OperationType)
            {
                OperationTypeValue = (int)EnumOperationType.SubscriptionCancellation;
            }
            else if (values2[3] == OperationType)
            {
                OperationTypeValue = (int)EnumOperationType.SubscriptionChange;
            }
            #endregion

            #region Update Data in Subscription Table
            var subscription = new Subscription()
            {
                ID = ID,
                Active = Active,
                Plan = Plan,
                Periodicity = Convert.ToString(EnumPeriodicityValue),
                Price = Price,
                LocationTargets = LocationTargets,
                PaymentStatus = Convert.ToString(EnumPaymentStatus),
                OperationType = Convert.ToString(OperationTypeValue),
                UpdatedAt = DateTime.UtcNow
            };
            subscription.Validity = new Validity(startDate, endDate);
            //Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry<Subscription> s = await _db.AddAsync(subscription);

            _db.Entry(subscription).Property(x => x.Active).IsModified = true;
            _db.Entry(subscription).Property(x => x.Plan).IsModified = true;
            _db.Entry(subscription).Property(x => x.Periodicity).IsModified = true;
            _db.Entry(subscription).Property(x => x.Price).IsModified = true;
            _db.Entry(subscription).Property(x => x.LocationTargets).IsModified = true;
            _db.Entry(subscription).Property(x => x.PaymentStatus).IsModified = true;

            _db.Entry(subscription.Validity).Property(x => x.StartDate).IsModified = true;
            _db.Entry(subscription.Validity).Property(x => x.EndDate).IsModified = true;

            _db.Entry(subscription).Property(x => x.OperationType).IsModified = true;
            _db.Entry(subscription).Property(x => x.UpdatedAt).IsModified = true;

            #endregion

            #region Insert Data in SubscriptionHistory Table

            string a = Convert.ToString(GuidComb.Generate());
            var subscriptionhistory = new SubscriptionHistory()
            {
                ID = a,
                Active = Active,
                Plan = Plan,
                Periodicity = Convert.ToString(EnumPeriodicityValue),
                Price = Price,
                LocationTargets = LocationTargets,
                PaymentStatus = Convert.ToString(EnumPaymentStatus),
                OperationType = Convert.ToString(OperationTypeValue)
            };
            subscriptionhistory.Validity = new Validity(startDate, endDate);

            Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry<SubscriptionHistory> y = await _db.AddAsync(subscriptionhistory);

            #endregion

            await _db.SaveChangesAsync();
            return subscription;
        }

In Subscription Class:
 public class Subscription: BaseEntity
    {
        public Subscription()
        {
            this.ID = Convert.ToString(System.Guid.NewGuid());
            this.CreatedAt = DateTime.UtcNow;
            this.IsCancel = false;
        }

        private List<Validity> validities = new List<Validity>();

        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [MaxLength(128)]
        public string ID { get; set; }

        public bool Active { get; set; }

        [MaxLength(150)]
        public string Plan { get; set; }

        [MaxLength(101)]
        public string Periodicity { get; set; }

        public decimal Price { get; set; }

        [MaxLength(250)]
        public string LocationTargets { get; set; }

        [MaxLength(101)]
        public string PaymentStatus { get; set; }

        public Validity Validity { get; set; }

        [MaxLength(101)]
        public string OperationType { get; set; }

        public bool IsCancel { get; set; }

        public DateTime CreatedAt { get; set; }

        public DateTime UpdatedAt { get; set; }

        public DateTime DeletedAt { get; set; }

        public bool Deleted { get; set; }

        //private List<Validity> validities = new List<Validity>();

        public void Assignvalidity(Validity validitys)
        {
            this.validities.Add(validitys);
        }

    }

In Validity Class:

 public class Validity : ValueObject
    {
        public DateTime StartDate { get; private set; }
        public DateTime EndDate { get; private set; }

        private Validity() { }

        public Validity(DateTime  startdate, DateTime enddate)
        {
            StartDate = startdate;
            EndDate = enddate;
        }

        protected override IEnumerable<object> GetAtomicValues()
        {
            yield return StartDate;
            yield return EndDate;
        }

    }

```