コード例 #1
0
        public async Task <IActionResult> Get(int groupId, int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var result = await transactionsService.Get(User, groupId, id);

            return(HandleGetResult(result, false));
        }
コード例 #2
0
        public async Task <IActionResult> GetTransaction([FromRoute] Guid transactionId)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var transaction = await _transactionsService.Get(transactionId);

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

            return(Ok(transaction));
        }
コード例 #3
0
        public async Task <IActionResult> Get()
        {
            var response = await _serviceTransaction.Get();

            if (response.ResponseH.Result != ResultTypeHelper.ResultMsg.OK)
            {
                var message = new HttpResponseMessage(HttpStatusCode.BadRequest)
                {
                    Content = new StringContent(response.ResponseH.ErrText)
                };
                return(BadRequest(message));
            }
            else
            {
                return(Ok(response.DataH));
            }
        }
コード例 #4
0
 public IActionResult Get(Guid id)
 {
     return(Ok(_transactionsService.Get(id)));
 }