public static async Task <List <EventLogReadModel> > GetList()
        {
            EventLogsListQuery       eventlogListQuery  = new EventLogsListQuery();
            List <EventLogReadModel> customerEventsLogs = await Mediator.Send(eventlogListQuery);

            return(customerEventsLogs);
        }
Exemple #2
0
        public Task <List <EventLogReadModel> > Handle(EventLogsListQuery request, CancellationToken cancellationToken)
        {
            IQueryable <EventLog>    customerEventsLogs = _customerEventsLogRepository.Query();
            List <EventLogReadModel> customerEventsLogsListReadModel = null;

            if (customerEventsLogs != null && customerEventsLogs.Any())
            {
                customerEventsLogsListReadModel = customerEventsLogs.Select(x => new EventLogReadModel
                {
                    Id        = x.Id,
                    CreatedOn = x.CreatedOn,
                    Data      = x.Data,
                    EntityId  = x.EntityId,
                    Type      = x.Type
                }).ToList();
            }

            return(Task.FromResult(customerEventsLogsListReadModel));
        }
        public async Task <ActionResult <List <EventLogReadModel> > > GetList([FromQuery] EventLogsListQuery query)
        {
            List <EventLogReadModel> customerEventsLogs = await _mediator.Send(query);

            return(customerEventsLogs);
        }