Ncqrs.Eventing.Storage.SQL.MsSqlServerEventStore.AddEventSource C# (CSharp) Method

AddEventSource() private static method

Adds the event source to the event store.
private static AddEventSource ( IEventSource eventSource, SqlTransaction transaction ) : void
eventSource IEventSource The event source to add.
transaction System.Data.SqlClient.SqlTransaction The transaction.
return void
        private static void AddEventSource(IEventSource eventSource, SqlTransaction transaction)
        {
            using (var command = new SqlCommand(InsertNewProviderQuery, transaction.Connection))
            {
                command.Transaction = transaction;
                command.Parameters.AddWithValue("Id", eventSource.EventSourceId);
                command.Parameters.AddWithValue("Type", eventSource.GetType().ToString());
                command.Parameters.AddWithValue("Version", eventSource.Version);
                command.ExecuteNonQuery();
            }
        }