Пример #1
0
        public static Criteria Map(this CampaignEntity entity, CampaignCriteriaSetEntity criteriaSetEntity, ICriteriaPersister criteriaPersister)
        {
            var type = ((CampaignCategory)entity.category).ToString();

            return(criteriaSetEntity == null
                ? criteriaPersister.CreateCriteria(type)
                : criteriaSetEntity.MapTo <CampaignCriteriaSetEntity, CampaignCriteriaEntity, Criteria>(type, criteriaPersister, false));
        }
Пример #2
0
 public static void MapTo(this Campaign campaign, CampaignEntity entity)
 {
     entity.name     = campaign.Name;
     entity.category = (int)campaign.Category;
     entity.communicationCategoryId   = campaign.CommunicationCategoryId;
     entity.communicationDefinitionId = campaign.CommunicationDefinitionId;
     entity.query = campaign.Query;
 }
Пример #3
0
        public static CampaignEntity Map(this Campaign campaign)
        {
            var entity = new CampaignEntity
            {
                id          = campaign.Id,
                createdTime = campaign.CreatedTime,
                createdBy   = campaign.CreatedBy,
                status      = (int)campaign.Status,
            };

            campaign.MapTo(entity);
            return(entity);
        }
Пример #4
0
        void ICampaignsRepository.UpdateStatus(Guid campaignId, CampaignStatus status)
        {
            using (var dc = CreateContext())
            {
                // Update just the campaign status.

                var entity = new CampaignEntity {
                    id = campaignId, status = -1
                };
                dc.CampaignEntities.Attach(entity);
                entity.status = (int)status;
                dc.SubmitChanges();
            }
        }
Пример #5
0
 public static Campaign Map(this CampaignEntity entity)
 {
     return(new Campaign
     {
         Id = entity.id,
         Name = entity.name,
         CreatedTime = entity.createdTime,
         CreatedBy = entity.createdBy,
         Status = (CampaignStatus)entity.status,
         Category = (CampaignCategory)entity.category,
         CommunicationCategoryId = entity.communicationCategoryId,
         CommunicationDefinitionId = entity.communicationDefinitionId,
         Query = entity.query,
     });
 }
Пример #6
0
 partial void DeleteCampaignEntity(CampaignEntity instance);
Пример #7
0
 partial void UpdateCampaignEntity(CampaignEntity instance);
Пример #8
0
 partial void InsertCampaignEntity(CampaignEntity instance);