public ActionResult Register([FromBody] CustomerDetail user) { var u = _loginsvc.GetUser(user.Email); if (u != null) { return(BadRequest("User already exists.")); } user.SetPassword(user.Password, _encryptor); user.EncryptImage(user.Profile_Photo); _loginsvc.InsertUser(user); var Message = new { Code = "0", Message = "Success" }; return(Ok(Message)); //return Ok(); }