/// <summary>
 /// Deprecated Method for adding a new object to the AccountActivities EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAccountActivities(AccountActivity accountActivity)
 {
     base.AddObject("AccountActivities", accountActivity);
 }
 /// <summary>
 /// Create a new AccountActivity object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="accountID">Initial value of the AccountID property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 /// <param name="emailSendCount">Initial value of the EmailSendCount property.</param>
 public static AccountActivity CreateAccountActivity(global::System.Int32 id, global::System.Int32 accountID, global::System.DateTime date, global::System.Int32 emailSendCount)
 {
     AccountActivity accountActivity = new AccountActivity();
     accountActivity.ID = id;
     accountActivity.AccountID = accountID;
     accountActivity.Date = date;
     accountActivity.EmailSendCount = emailSendCount;
     return accountActivity;
 }
        public AccountActivity UpdateAccountActivity(Account account, int activityCount)
        {
            AccountActivity activity = new AccountActivity();
            activity.Date = DateTime.Now;
            activity.EmailSendCount = activity.EmailSendCount + activityCount;
            account.AccountActivities.Add(activity);
            _dbContext.SaveChanges();

            return activity;
        }