Пример #1
0
        public async Task <IActionResult> Edit([FromBody] BankEntry pModel)
        {
            // Validation
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            if (Validate(pModel, true) == false)
            {
                return(BadRequest(ModelState));
            }
            else
            {
                // Execution of concrete process
                SQLResult result = new SQLResult();
                result = await _repo.Edit(pModel);

                if (result.ErrorNo > 0)
                {
                    return(BadRequest(result));
                }
                else
                {
                    return(Ok(result));
                }
            }
        }