Ejemplo n.º 1
0
        public Task <List <SubcriptionConfigurationReadModel> > Handle(SubscriptionConfigurationsListQuery request, CancellationToken cancellationToken)
        {
            IQueryable <SubscriptionConfiguration>   configurations = _configurationRepository.Query();
            List <SubcriptionConfigurationReadModel> configurationsListReadModel = null;

            if (configurations != null && configurations.Any())
            {
                configurationsListReadModel = configurations.Select(x => new SubcriptionConfigurationReadModel {
                    Id = x.Id, SubcriptionId = x.SubcriptionId, ConfigurationId = x.ConfigurationId, Enabled = x.Enabled
                }).ToList();
            }

            return(Task.FromResult(configurationsListReadModel));
        }
        public async Task <ActionResult <List <SubcriptionConfigurationReadModel> > > GetList([FromQuery] SubscriptionConfigurationsListQuery query)
        {
            List <SubcriptionConfigurationReadModel> subscriptionConfigurations = await _mediator.Send(query);

            return(subscriptionConfigurations);
        }