Exemplo n.º 1
0
        public IActionResult Submit([FromQuery] string name, [FromQuery] string password, [FromQuery] string contact)
        {
            name = GlobalFunc.MyUrlDeCode(name, Encoding.UTF8);
            var info = new RegisterModel
            {
                Name     = name,
                Password = password,
                Contact  = contact
            };
            var             newId = 0;
            IReaderRegister reg   = new ReaderRegister();

            try
            {
                newId = reg.AccepteRegister(info);
            }
            catch (Exception ex)
            {
                return(Ok(new { error = ex.Message }));
            }

            return(Ok(new { id = newId }));
        }