Exemplo n.º 1
0
        public async Task <ActionResult <IEnumerable <GetEntriesResponse> > > GetEntries()
        {
            var query  = new GetEntriesRequest();
            var result = await _mediator.Send(query);

            return(Ok(result));
        }
Exemplo n.º 2
0
        public QueueEntry[] GetMyEntries(string name)
        {
            GetEntriesRequest request = new GetEntriesRequest();

            request.AssignedTo = name;
            return(Translator.Translate <QueueEntry[]>(_customerQueueServiceProxy.GetEntries(request)));
        }
Exemplo n.º 3
0
        public IList <HostEntry> GetEntries()
        {
            var request = new GetEntriesRequest();

            PropertyBag responseBag = (PropertyBag)base.Invoke("GetEntries", new object[] { request.ToPropertyBag() });

            var response = new GetEntriesResponse(responseBag);

            return(response.Entries);
        }
Exemplo n.º 4
0
        public async Task <IEnumerable <GetEntriesResponse> > Handle(GetEntriesRequest request, CancellationToken cancellationToken)
        {
            var entries = await _dbContext.Entries
                          .Include(entry => entry.Photos)
                          .ThenInclude(photo => photo.Camera)
                          .Include(entry => entry.Photos)
                          .ThenInclude(photo => photo.Film)
                          .ToListAsync();

            return(_mapper.Map <IEnumerable <GetEntriesResponse> >(entries));
        }
Exemplo n.º 5
0
        public async Task <bool> Handle(GetEntriesRequest message, IOutputPort <GetEntriesResponse> outputPort)
        {
            Entry[] entries = null;
            try
            {
                await Task.Run(() =>
                {
                    entries = _Repo.List(message.Query).ToArray();
                });

                outputPort.Handle(new GetEntriesResponse(entries, true, null));
                return(true);
            }
            catch (Exception ex)
            {
                outputPort.Handle(new GetEntriesResponse(null, false, ex.ToString()));
                return(false);
            }
        }