예제 #1
0
 public void DeleteInstanceProperty(InstanceProperty instanceProperty)
 {
     if ((instanceProperty.EntityState == EntityState.Detached))
     {
         this.ObjectContext.InstanceProperties.Attach(instanceProperty);
     }
     this.ObjectContext.InstanceProperties.DeleteObject(instanceProperty);
 }
예제 #2
0
        /// <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);
        }
예제 #3
0
 public void InsertInstanceProperty(InstanceProperty instanceProperty)
 {
     if ((instanceProperty.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(instanceProperty, EntityState.Added);
     }
     else
     {
         this.ObjectContext.InstanceProperties.AddObject(instanceProperty);
     }
 }
예제 #4
0
 public void UpdateInstanceProperty(InstanceProperty currentInstanceProperty)
 {
     this.ObjectContext.InstanceProperties.AttachAsModified(currentInstanceProperty, this.ChangeSet.GetOriginal(currentInstanceProperty));
 }
예제 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the InstanceProperties EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToInstanceProperties(InstanceProperty instanceProperty)
 {
     base.AddObject("InstanceProperties", instanceProperty);
 }