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

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