コード例 #1
0
 public async Task <object> AbrirPuerta([FromBody] ReaderPath_DTO pathReader)
 {
     try {
         return(await _reader_REP_LOCAL.AbrirPuerta(pathReader));
     }
     catch (Exception ex) { return(BadRequest(ex.Message)); }
 }
コード例 #2
0
        public async Task <object> AbrirPuerta([FromBody] ReaderPath_DTO pathReader)
        {
            try {
                object result = new
                {
                    sucess = await _reader_REP_LOCAL.AbrirPuerta(pathReader),
                    status = 200,
                    data   = "Done"
                };

                return(result);
            }
            catch (Exception ex)
            {
                object result = new
                {
                    sucess = false,
                    status = 400,
                    data   = ex.Message
                };

                return(BadRequest(result));
            }
        }