/// <summary> /// End a Service Broker dialog. /// </summary> /// <returns></returns> public static Func <Maybe <Log>, Func <IDbConnection>, OpenAsync, ExecuteNonQueryAsync, Guid, TryAsync <Unit> > EndDialogAsyncFactory() => (log, connectionFactory, openAsync, exeAsync, conversationId) => CommandFactoryAsync <Unit>()( log, connectionFactory, openAsync, SetupEndDialog().Par(log, conversationId.AssertValue()), async cmd => { await exeAsync(cmd); return(unit); });
/// <summary> /// Gets a message from a Service Broker Queue. /// </summary> /// <returns></returns> public static Func <Maybe <Log>, Func <IDbConnection>, OpenAsync, ExecuteNonQueryAsync, string, TryAsync <BrokerMessage> > GetMessageAsyncFactory() => (log, connectionFactory, openAsync, exeAsync, queueName) => CommandFactoryAsync <BrokerMessage>()( log, connectionFactory, openAsync, SetupReceive().Par(queueName.AssertValue()), RunReceiveCommandFactory().Par(log, exeAsync));