public ContentManagerSetting SaveSetting(ContentManagerSetting setting) { using (var db = new ContentManagerEntities()) { db.ContentManagerSettings.Attach(setting); db.ObjectStateManager.ChangeObjectState(setting, System.Data.EntityState.Modified); db.SaveChanges(); return setting; } }
/// <summary> /// Deprecated Method for adding a new object to the ContentManagerSettings EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToContentManagerSettings(ContentManagerSetting contentManagerSetting) { base.AddObject("ContentManagerSettings", contentManagerSetting); }
/// <summary> /// Create a new ContentManagerSetting object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="description">Initial value of the Description property.</param> /// <param name="value">Initial value of the Value property.</param> public static ContentManagerSetting CreateContentManagerSetting(global::System.Int32 id, global::System.String name, global::System.String description, global::System.String value) { ContentManagerSetting contentManagerSetting = new ContentManagerSetting(); contentManagerSetting.ID = id; contentManagerSetting.Name = name; contentManagerSetting.Description = description; contentManagerSetting.Value = value; return contentManagerSetting; }