public void DeleteInstanceProperty(InstanceProperty instanceProperty) { if ((instanceProperty.EntityState == EntityState.Detached)) { this.ObjectContext.InstanceProperties.Attach(instanceProperty); } this.ObjectContext.InstanceProperties.DeleteObject(instanceProperty); }
/// <summary> /// Create a new InstanceProperty object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="logicalInstanceId">Initial value of the LogicalInstanceId property.</param> public static InstanceProperty CreateInstanceProperty(global::System.Int32 id, global::System.String name, global::System.Int32 logicalInstanceId) { InstanceProperty instanceProperty = new InstanceProperty(); instanceProperty.Id = id; instanceProperty.Name = name; instanceProperty.LogicalInstanceId = logicalInstanceId; return(instanceProperty); }
public void InsertInstanceProperty(InstanceProperty instanceProperty) { if ((instanceProperty.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(instanceProperty, EntityState.Added); } else { this.ObjectContext.InstanceProperties.AddObject(instanceProperty); } }
public void UpdateInstanceProperty(InstanceProperty currentInstanceProperty) { this.ObjectContext.InstanceProperties.AttachAsModified(currentInstanceProperty, this.ChangeSet.GetOriginal(currentInstanceProperty)); }
/// <summary> /// Deprecated Method for adding a new object to the InstanceProperties EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToInstanceProperties(InstanceProperty instanceProperty) { base.AddObject("InstanceProperties", instanceProperty); }