Beispiel #1
0
        public ActionResult RegisterUser(
            string FullName,
            string ProfileImage
            )
        {
            string message = "";

            using (var db = new DBQuizEntities())
            {
                var users = db.Set <User>();
                users.Add(new User {
                    FullName = FullName, ProfilImage = ProfileImage
                });
                int status = db.SaveChanges();
                if (status > 0)
                {
                    message = "Save data successfully";
                }
                else
                {
                    message = "Save data failed.";
                }
            }
            return(Json(message, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet));
        }