public async Task<IHttpActionResult> Register(RegisterBindingModel model)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            var user = new Student(1) { UserName = model.Email, Email = model.Email };

            IdentityResult result = await UserManager.CreateAsync(user, model.Password);


            if (!result.Succeeded)
            {
                return GetErrorResult(result);
            }

            return Ok();
        }
Exemplo n.º 2
0
 public void AddStudent(Student student)
 {
     this.Students.Add(student);
 }