Esempio n. 1
0
        public async Task <IEnumerable <AdmissionResponse> > Execute(GetAdmissionsQuery cmd, CqrsContext ctx, CancellationToken cancellationToken = new CancellationToken())
        {
            var entities = await _admissionRepository.GetAllByVisitor(new ObjectId(cmd.VisitorId));

            var dtos = entities.Select(x => new AdmissionResponse(x));

            return(dtos);
        }
Esempio n. 2
0
        public async Task <IEnumerable <AdmissionResponse> > GetAllByVisitor(string visitorId)
        {
            var query = new GetAdmissionsQuery(visitorId);

            var response = await _cqrsDispatcher.ExecuteQuery <GetAdmissionsQuery, IEnumerable <AdmissionResponse> >(query, null, new CancellationToken());

            return(response);
        }