public async Task <object> OwnedStockDetails(string ticker) { var query = new Get.Query(ticker); query.WithUserId(User.Identifier()); return(await _mediator.Send(query)); }
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); }
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); }