예제 #1
0
        public async Task <object> OwnedStockDetails(string ticker)
        {
            var query = new Get.Query(ticker);

            query.WithUserId(User.Identifier());

            return(await _mediator.Send(query));
        }
예제 #2
0
        public async Task Get_WorksAsync()
        {
            var storage = _fixture.CreateStorageWithSoldOption();
            var opt     = storage.SavedOptions.First();
            var query   = new Get.Query {
                Id = opt.State.Id
            };

            query.WithUserId(opt.State.UserId);

            var handler = new Get.Handler(storage);

            var result = await handler.Handle(query, CancellationToken.None);

            Assert.NotNull(result);
        }
예제 #3
0
        public async Task <object> Get(Guid id)
        {
            var query = new Get.Query {
                Id = id
            };

            query.WithUserId(this.User.Identifier());

            var option = await _mediator.Send(query);

            if (option == null)
            {
                return(NotFound());
            }

            return(option);
        }