/// <summary>
 /// Deprecated Method for adding a new object to the tbl_UserQuestions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotbl_UserQuestions(tbl_UserQuestions tbl_UserQuestions)
 {
     base.AddObject("tbl_UserQuestions", tbl_UserQuestions);
 }
        public ActionResult Edit(tbl_UserQuestions tbl_userquestions)
        {
            tbl_userquestions.ModifiedBy = User.Identity.Name;
            tbl_userquestions.ModifiedDate = DateTime.Now;
            if (ModelState.IsValid)
            {

                db.tbl_UserQuestions.Attach(tbl_userquestions);
                db.ObjectStateManager.ChangeObjectState(tbl_userquestions, EntityState.Modified);
                //Audit
                db.tbl_AuditTrail.AddObject(new tbl_AuditTrail
                {
                    Action = "UPDATE",
                    ActionItem = "UserQuestion",
                    UserName = User.Identity.Name,
                    ActionDate = DateTime.Now
                });
                db.SaveChanges();
                return RedirectToAction("Index");
            }
            ViewBag.UserId = new SelectList(db.tbl_UserDetails, "UserId", "Name", tbl_userquestions.UserId);
            return View(tbl_userquestions);
        }
 /// <summary>
 /// Create a new tbl_UserQuestions object.
 /// </summary>
 /// <param name="question_Id">Initial value of the Question_Id property.</param>
 /// <param name="question">Initial value of the Question property.</param>
 /// <param name="userId">Initial value of the UserId property.</param>
 /// <param name="createdBy">Initial value of the CreatedBy property.</param>
 /// <param name="createdDate">Initial value of the CreatedDate property.</param>
 public static tbl_UserQuestions Createtbl_UserQuestions(global::System.Int32 question_Id, global::System.String question, global::System.Int32 userId, global::System.String createdBy, global::System.DateTime createdDate)
 {
     tbl_UserQuestions tbl_UserQuestions = new tbl_UserQuestions();
     tbl_UserQuestions.Question_Id = question_Id;
     tbl_UserQuestions.Question = question;
     tbl_UserQuestions.UserId = userId;
     tbl_UserQuestions.CreatedBy = createdBy;
     tbl_UserQuestions.CreatedDate = createdDate;
     return tbl_UserQuestions;
 }