public void Match(Campaign campaign) { var buyers = buyerRepository.FindAll(b => !b.IsUnsubscribed).ToList(); var products = productRepository.FindAll(p => true).ToList(); campaign.Matches = matchingService.Match(buyers, products); AddMessagesToContext(campaign); }
private Campaign Create(string name, string subject, string content) { Campaign created = new Campaign(); saver.AddToContext(created); created.Created = calendarService.CurrentDateTime; created.Name = name; created.Subject = subject; created.Content = content; return created; }
public Campaign Build() { var campaign = new Campaign {AgencyId = defaultAgencyId, Created = defaultCreated, Id = defaultId, Name = defaultName, Subject = defaultSubject, Content = defaultContent, Sent = defaultSent }; if (defaultMessage != null) campaign.Messages.Add(defaultMessage); return campaign; }
private static void AssertInvalidWithErrorMessages(Campaign campaign) { Assert.IsFalse(campaign.IsValid); Assert.IsTrue(campaign.Errors.Count > 0); Console.WriteLine(String.Join(" ", campaign.Errors.Select(ve => ve.ErrorMessage).ToArray())); }
private void AddMessagesToContext(Campaign campaign) { foreach (Message message in campaign.Messages) { campaignRepository.AddToContext(message); } }
partial void DeleteCampaign(Campaign instance);
partial void UpdateCampaign(Campaign instance);
partial void InsertCampaign(Campaign instance);