public void AddCallBackToDB(CallBackModel model) { using (var context = new CallBackContext()) { model.Date = DateTime.Now; context.CallBackModels.Add(model); context.SaveChanges(); } }
public ActionResult Reg(CallBack callBack) { if (ModelState.IsValid) { callBack.Id = Guid.NewGuid(); db.CallBacks.Add(callBack); db.SaveChanges(); } return(View("Reg")); }