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

            var info = await Authentication.GetExternalLoginInfoAsync();
            if (info == null) {
                return InternalServerError();
            }
            
            var user = new ApplicationUser() { UserName = model.Email, Email = model.Email };
            
            IdentityResult result = await UserManager.CreateAsync(user);
            
            if (!result.Succeeded) {
                return GetErrorResult(result);
            }

            result = await UserManager.AddLoginAsync(user.Id, info.Login);
            if (!result.Succeeded) {
                return GetErrorResult(result);
            }
            return Ok();
        }
        public async Task<IHttpActionResult> Register(RegisterBindingModel model) {
            if (!ModelState.IsValid) {
                return BadRequest(ModelState);
            }

            var user = new ApplicationUser() { UserName = model.Email, Email = model.Email, Name = model.Name, Title = model.Title, CompanyName = model.CompanyName, PhoneNumber = model.PhoneNumber, PhoneNumber2 = model.PhoneNumber2 };

            IdentityResult result = await UserManager.CreateAsync(user, model.Password);
            result = await UserManager.AddToRoleAsync(user.Id, Role.Contractor);

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

            return Ok();
        }