コード例 #1
0
        public virtual IEventStoreConnection GetEventStoreConnection()
        {
            ConnectionSettings    settings   = ConnectionSettings.Create();
            IPEndPoint            endPoint   = GetEventStoreIpEndPoint();
            IEventStoreConnection connection = EventStoreConnection.Create(settings, endPoint);
            Task connecting = connection.ConnectAsync();

            connecting.Wait();

            EventData connectionEvent = EventBuilder.CreateClientConnectedEvent(GetEventStoreClientName());
            Task      notify          = connection.AppendToStreamAsync(GetEventStoreConnectionLogStreamName(), ExpectedVersion.Any, connectionEvent);

            notify.Wait();

            return(connection);
        }