private void Apply(ReportDefinitionCreatedEvent reportDefinitionCreatedEvent) { SystemAccountKey = reportDefinitionCreatedEvent.SystemAccountKey; ReportName = reportDefinitionCreatedEvent.ReportName; DisplayName = reportDefinitionCreatedEvent.DisplayName; IsPatientCentric = reportDefinitionCreatedEvent.IsPatientCentric; }
/// <summary> /// Handles the specified message. /// </summary> /// <param name="message">The message.</param> public void Handle(ReportDefinitionCreatedEvent message) { using (var connection = _connectionFactory.CreateConnection()) { connection.Execute( @"INSERT INTO ReportModule.ReportDefinition(ReportDefinitionKey, ReportName, DisplayName, IsPatientCentric) VALUES(@ReportDefinitionKey, @ReportName, @DisplayName, @IsPatientCentric)", new { ReportDefinitionKey = message.Key, message.ReportName, message.DisplayName, message.IsPatientCentric }); } }