Esempio n. 1
0
        public Task <decimal> Handle(GetBankAccountBalance request, CancellationToken cancellationToken)
        {
            //Validate query?

            var balance = repository.GetBankAccountBalance(request.BankAccountId);

            return(Task.FromResult(balance));
        }
        public async Task <HttpResponseMessage> GetBalance([FromUri] string id)
        {
            var command = new GetBankAccountBalance
            {
                BankAccountId = id
            };
            var balance = await mediator.Send(command);

            return(Request.CreateResponse(HttpStatusCode.OK, balance));
        }