public JsonResult InsertTodoItem(String id) { try { Simple.Models.Datum oDatum = new Simple.Models.Datum(); oDatum.Todo = id; oDatum.Sort =db.Data.Count()+1; db.Data.AddObject(oDatum); db.SaveChanges(); return Json(true, JsonRequestBehavior.AllowGet); } catch (Exception ex) { } return null; }
/// <summary> /// Deprecated Method for adding a new object to the Data EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToData(Datum datum) { base.AddObject("Data", datum); }
/// <summary> /// Create a new Datum object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="sort">Initial value of the Sort property.</param> public static Datum CreateDatum(global::System.Int32 id, global::System.Int32 sort) { Datum datum = new Datum(); datum.Id = id; datum.Sort = sort; return datum; }