Ejemplo n.º 1
0
        public async Task <IEnumerable <Subscription> > GetAll(CancellationToken cancellationToken)
        {
            var command = new CommandDefinition(SqlSubscriptionQueries.GetAllSubscriptions, cancellationToken: cancellationToken);
            var reader  = await _connection.QueryMultipleAsync(command);

            var manager = await SubscriptionDtoManager.ReadAsync(reader);

            return(manager.FormatSubscriptions());
        }
Ejemplo n.º 2
0
        public async Task <Subscription> GetById(string subscriptionId, CancellationToken cancellationToken)
        {
            var command = new CommandDefinition(SqlSubscriptionQueries.GetSubscriptionById, new { subscriptionId }, cancellationToken: cancellationToken);
            var reader  = await _connection.QueryMultipleAsync(command);

            var manager = await SubscriptionDtoManager.ReadAsync(reader);

            return(manager.FormatSubscriptions().FirstOrDefault());
        }