public async Task <object> Get(Guid noteId) { var query = new Get.Query(User.Identifier(), noteId); var result = await _mediator.Send(query); return(result); }
public async Task <ActionResult <string> > Get([FromRoute] Guid id) { var command = new Get.Query(id); var response = await _mediator.Send(command); return(Ok(response)); }
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 <IActionResult> GetTask(Get.Query query) { _logger.LogInformation("Start GetTasks query"); var task = await _mediator.Send(query); _logger.LogInformation("End GetTasks query"); return(Ok(task)); }
public async Task ShouldGetAllMedicationsWhenNoParameters() { // arrange; var query = new Get.Query(null, null); // act; var res = await SendMediatorRequestInScope(query); // assert; res.Should().NotBeNullOrEmpty(); }
public async Task ShouldReturnEmptyListIfTheChemicalSubstanceDoesNotExist() { // arrange; const string chemicalSubstance = "LITERALLY_MADE_UP"; var query = new Get.Query(chemicalSubstance, null); // act; var res = await SendMediatorRequestInScope(query); // assert; res.Should().BeEmpty(); }
public async Task ShouldReturnFis() { // arrange; var query = new Get.Query(); // act; var res = await SendMediatorRequestInScope(query); // assert; res.Should() .NotBeNullOrEmpty(); }
public async Task ShouldReturnEmptyListIfTheProductNameDoesNotExist() { // arrange; const string productName = "LITERALLY_MADE_UP"; var query = new Get.Query(null, productName); // act; var res = await SendMediatorRequestInScope(query); // assert; res.Should().BeEmpty(); }
public async Task<IHttpActionResult> Get(int id) { // Return a bad request if the query url has no id if (id == 0) return BadRequest("id cannot be empty"); // Create a query object to be passed to the mediator var query = new Get.Query() { Id = id }; // Send an async request through the mediator var entity = await _mediator.SendAsync(query); // Return not found if the response is empty if (entity == null) return NotFound(); // Return the entity found return Ok(entity); }
public async Task ShouldGetMedicationsWithAGivenSubstanceNameWhenItExists() { // arrange; const string chemicalSubstance = "Budesonide"; var query = new Get.Query(chemicalSubstance, null); // act; var res = await SendMediatorRequestInScope(query); // assert; res.Should() .NotBeEmpty().And .OnlyContain(m => m.BnfChemicalSubstance.Equals(chemicalSubstance)); }
public async Task ShouldGetMedicationsWithAGivenProductNameWhenItExists() { // arrange; const string productName = "Cortiment"; var query = new Get.Query(null, productName); // act; var res = await SendMediatorRequestInScope(query); // assert; res.Should() .NotBeEmpty().And .OnlyContain(m => m.BnfProduct !.Equals(productName)); }
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 ShouldGetMedicationsWhenBothValuesValid() { // arrange; const string chemicalSubstance = "Budesonide"; const string productName = "Cortiment"; var query = new Get.Query(chemicalSubstance, productName); // act; var res = await SendMediatorRequestInScope(query); // assert; res.Should() .NotBeEmpty().And .OnlyContain(m => m.BnfProduct !.Equals(productName) && m.BnfChemicalSubstance.Equals(chemicalSubstance)); }
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); }
public async Task <IActionResult> Get([FromRoute] Get.Query query) { var post = await _mediator.Send(query); return(Ok(post)); }
public Task <object> Index() { var query = new Get.Query(this.User.Identifier()); return(_mediator.Send(query)); }
public async Task <object> Get(string ticker) { var query = new Get.Query(User.Identifier(), ticker); return(await _mediator.Send(query)); }
public async Task <ActionResult <IEnumerable <AppointmentDto> > > GetMyAppointments([FromQuery] Get.Query query) { var res = await _mediator.Send(query); return(Ok(res)); }
public async Task <ActionResult <IEnumerable <MedicationDto> > > Get([FromQuery] Get.Query query) { var res = await _mediator.Send(query); return(Ok(res)); }
public async Task <ActionResult> Get(Get.Query query) { return(Ok(await mediator.Send(query))); }
public Task <PortfolioResponse> Index() { var query = new Get.Query(User.Identifier()); return(_mediator.Send(query)); }
public async Task <IHttpActionResult> Ping(Get.Query query) => await Ok(Mediator.Send(query ?? new Get.Query()));
public async Task <Game> GetGame([FromRoute] Get.Query query) { var response = await _mediator.Send(query); return(response); }