Exemplo n.º 1
0
        public IHttpActionResult post(UserDto User)
        {
            AuthBL         repos  = new AuthBL();
            IdentityResult MyUser = repos.Create(User);

            if (MyUser.Succeeded)
            {
                return(Created("", "Created"));
            }
            else
            {
                return(BadRequest(MyUser.Errors.FirstOrDefault()));
            }
        }
Exemplo n.º 2
0
        //you must install identity owin and owin self owin hosting
        public IHttpActionResult Post(UserDTO userdto)
        {
            if (ModelState.IsValid == false)
            {
                return(BadRequest(ModelState));
            }

            AuthBL         repos  = new AuthBL();
            IdentityResult result = repos.Create(userdto);

            if (result.Succeeded)
            {
                return(Created("", "Created"));
            }

            return(BadRequest(result.Errors.FirstOrDefault()));
        }