Exemple #1
0
        public async Task <IEnumerable <VisitorResponse> > Get()
        {
            var query = new GetVisitorsQuery();

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

            return(response);
        }
Exemple #2
0
        public async Task <AdmissionResponse> Create([FromBody] CreateAdmissionRequest request)
        {
            var cmd = new CreateAdmissionCommand(request);
            await _cqrsDispatcher.ExecuteCommand(cmd, null, new CancellationToken());

            var query    = new GetAdmissionQuery(request.VisitorId, cmd.Id);
            var response = await _cqrsDispatcher.ExecuteQuery <GetAdmissionQuery, AdmissionResponse>(query, null, new CancellationToken());

            return(response);
        }