public static bool AddWidGet(WidGet data) { using (InventioEntities context = new InventioEntities()) { context.AddToWidGet(data); context.SaveChanges(); } return true; }
public static bool AddWidGet(string IdContainer, string type, int position, string DataXML) { WidGet widget = new WidGet(); widget.IdContainer = IdContainer; widget.Type = type; widget.Position = position; widget.Data = DataXML; AddWidGet(widget); return true; }
public static bool UpdateWidGet(WidGet data) { using (InventioEntities context = new InventioEntities()) { data.EntityKey = new EntityKey("InventioEntities.WidGet", "ID", data.ID); context.Attach(data); context.ObjectStateManager.GetObjectStateEntry(data).SetModified(); context.Refresh(RefreshMode.ClientWins, data); context.SaveChanges(); } return true; }
/// <summary> /// Deprecated Method for adding a new object to the WidGet EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToWidGet(WidGet widGet) { base.AddObject("WidGet", widGet); }
/// <summary> /// Create a new WidGet object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="idContainer">Initial value of the IdContainer property.</param> /// <param name="type">Initial value of the Type property.</param> public static WidGet CreateWidGet(global::System.Int32 id, global::System.String idContainer, global::System.String type) { WidGet widGet = new WidGet(); widGet.ID = id; widGet.IdContainer = idContainer; widGet.Type = type; return widGet; }