void IIntegrationReportsRepository.CreateJobAdIntegrationEvent(JobAdIntegrationEvent evt) { using (var dc = CreateDataContext(false)) { if (evt is JobAdImportCloseEvent) { dc.JobAdImportCloseEventEntities.InsertOnSubmit(((JobAdImportCloseEvent)evt).Map()); } else if (evt is JobAdImportPostEvent) { dc.JobAdImportPostEventEntities.InsertOnSubmit(((JobAdImportPostEvent)evt).Map()); } if (evt is JobAdExportCloseEvent) { dc.JobAdExportCloseEventEntities.InsertOnSubmit(((JobAdExportCloseEvent)evt).Map()); } else if (evt is JobAdExportPostEvent) { dc.JobAdExportPostEventEntities.InsertOnSubmit(((JobAdExportPostEvent)evt).Map()); } else if (evt is JobAdExportFeedEvent) { dc.JobAdExportFeedEventEntities.InsertOnSubmit(((JobAdExportFeedEvent)evt).Map()); } else if (evt is JobAdExportFeedIdEvent) { dc.JobAdExportFeedIdEventEntities.InsertOnSubmit(((JobAdExportFeedIdEvent)evt).Map()); } dc.SubmitChanges(); } }
private static JobAdIntegrationEventEntity Map(this JobAdIntegrationEvent evt) { return(new JobAdIntegrationEventEntity { id = evt.Id, time = evt.Time, integratorUserId = evt.IntegratorUserId, success = evt.Success, jobAds = evt.JobAds, }); }
void IJobAdIntegrationReportsCommand.CreateJobAdIntegrationEvent(JobAdIntegrationEvent evt) { evt.Prepare(); evt.Validate(); _repository.CreateJobAdIntegrationEvent(evt); }