예제 #1
0
        public async Task <IActionResult> GetByDni(string dni)
        {
            InfractorBusiness infractorBusiness = new InfractorBusiness();
            var result = infractorBusiness.GetByDni(_context, dni);

            if (result.Error == false)
            {
                return(Ok(result));
            }
            else
            {
                return(BadRequest(result));
            }
        }
예제 #2
0
        public async Task <IActionResult> Add(InfractorEntity model)
        {
            InfractorBusiness infractorBusiness = new InfractorBusiness();
            var result = infractorBusiness.Add(_context, model);

            if (result.Error == false)
            {
                return(Ok(result));
            }
            else
            {
                return(BadRequest(result));
            }
        }