/// <summary> /// Creates a connection to event store, which can both read and write events. /// </summary> /// <param name="storageConfiguration">Storage configuration (either local file path /// or <see cref="AzureStoreConfiguration"/>).</param> /// <param name="storeId">Id of the store to connect to</param> /// <param name="platformServerEndpoint">URL of public server API.</param> /// <returns>new instance of the client that can read and write events.</returns> public static IRawEventStoreClient ConnectToEventStore(string storageConfiguration, string storeId, string platformServerEndpoint) { var container = EventStoreId.Parse(storeId); AzureStoreConfiguration configuration; if (!AzureStoreConfiguration.TryParse(storageConfiguration, out configuration)) { return(new FileEventStoreClient(storageConfiguration, container, platformServerEndpoint)); } return(new AzureEventStoreClient(configuration, container, platformServerEndpoint)); }
/// <summary> /// Creates a connection to event store, which can only both read and write events. /// Platform API connection is not needed. /// </summary> /// <param name="storageConfiguration">Storage configuration (either local file path /// or <see cref="AzureStoreConfiguration"/>)</param> /// <param name="storeId">Id of the store to connect to</param> /// <returns>new instance of the client that can read events</returns> public static IRawEventStoreClient ConnectToEventStoreAsReadOnly( string storageConfiguration, string storeId) { var container = EventStoreId.Parse(storeId); AzureStoreConfiguration configuration; if (!AzureStoreConfiguration.TryParse(storageConfiguration, out configuration)) { return(new FileEventStoreClient(storageConfiguration, container)); } return(new AzureEventStoreClient(configuration, container)); }