public async Task <IActionResult> Get(string key)
        {
            var request = new GetValueItemRequest(key);

            var response = await mediator.Send(request);

            return(response.ValueItem.Match(r => (IActionResult)Ok(new ValueItem(r)), () => (IActionResult)NotFound(key)));
        }
Exemple #2
0
        public void ValidateTheRequest(string key, bool isValid)
        {
            var validator = new GetValueItemValidator();
            var request   = new GetValueItemRequest(key);

            var result = validator.Validate(request);

            result.IsValid.Should().Be(isValid);
        }