Ejemplo n.º 1
0
 public static CommitWork <AdoNetTransactionUowProvider <TConnectionStringName> > CommitWork(Func <string, string> getConnectionString)
 {
     return(doWork =>
     {
         using (var t = new AdoNetTransactionUowProvider <TConnectionStringName>(getConnectionString))
         {
             doWork(t);
             t.Value.Commit();
         }
     });
 }
Ejemplo n.º 2
0
        public static EventStoreConfiguration <TEventStoreConnectionStringName> ConfigurePublishers <TEventStoreConnectionStringName>(
            this EventStoreConfiguration <TEventStoreConnectionStringName> config)
            where TEventStoreConnectionStringName : class
        {
            EventStore <AdoNetTransactionUowProvider <TEventStoreConnectionStringName> > .NotificationsByCorrelationsFunction =
                t => SqlEventStore.NotificationsByCorrelations(t.Value);

            EventStore <AdoNetTransactionUowProvider <TEventStoreConnectionStringName> > .PublisherVersionByCorrelationsFunction =
                t => SqlEventStore.PublisherVersionByContractAndCorrelations(t.Value);

            EventStore <AdoNetTransactionUowProvider <TEventStoreConnectionStringName> > .SaveNotificationsByPublisherAndVersionAction =
                t => SqlEventStore.SaveNotificationsByPublisherAndVersion(t.Value);

            EventStore <AdoNetTransactionUowProvider <TEventStoreConnectionStringName> > .CommitEventStoreWork =
                AdoNetTransactionUowProvider <TEventStoreConnectionStringName> .CommitWork(ConnectionString.ByName);

            return(config);
        }