コード例 #1
0
 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);
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
ファイル: CampaignTests.cs プロジェクト: liammclennan/Herald
 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()));
 }
コード例 #5
0
 private void AddMessagesToContext(Campaign campaign)
 {
     foreach (Message message in campaign.Messages)
     {
         campaignRepository.AddToContext(message);
     }
 }
コード例 #6
0
 partial void DeleteCampaign(Campaign instance);
コード例 #7
0
 partial void UpdateCampaign(Campaign instance);
コード例 #8
0
 partial void InsertCampaign(Campaign instance);