public async Task<bool> AddSubscriber(SeedDiscrepancy discrepancy) { var emailAddress = discrepancy.EmailAddress; var subscriberInStore = (await GetSubscribers(x => x.email.Trim() == emailAddress)).SingleOrDefault(); if (subscriberInStore != null) { return await this.Update(subscriberInStore.SetMailable()); } else { return await this.Add ( discrepancy .ToSubscriber() .SetMailable() .Set(x => x.insertionDate, DateTime.Now) ); } }
public async Task<bool> EnableSubscriber(SeedDiscrepancy discrepancy) { return await this.Update(discrepancy.ToSubscriber().SetMailable()); }