コード例 #1
0
 public void DeleteLogicalInstance(LogicalInstance logicalInstance)
 {
     if ((logicalInstance.EntityState == EntityState.Detached))
     {
         this.ObjectContext.LogicalInstances.Attach(logicalInstance);
     }
     this.ObjectContext.LogicalInstances.DeleteObject(logicalInstance);
 }
コード例 #2
0
        /// <summary>
        /// Create a new LogicalInstance object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="type">Initial value of the Type property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        public static LogicalInstance CreateLogicalInstance(global::System.Int32 id, global::System.String type, global::System.String name)
        {
            LogicalInstance logicalInstance = new LogicalInstance();

            logicalInstance.Id   = id;
            logicalInstance.Type = type;
            logicalInstance.Name = name;
            return(logicalInstance);
        }
コード例 #3
0
 public void InsertLogicalInstance(LogicalInstance logicalInstance)
 {
     if ((logicalInstance.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(logicalInstance, EntityState.Added);
     }
     else
     {
         this.ObjectContext.LogicalInstances.AddObject(logicalInstance);
     }
 }
コード例 #4
0
 public void UpdateLogicalInstance(LogicalInstance currentLogicalInstance)
 {
     this.ObjectContext.LogicalInstances.AttachAsModified(currentLogicalInstance, this.ChangeSet.GetOriginal(currentLogicalInstance));
 }
コード例 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the LogicalInstances EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLogicalInstances(LogicalInstance logicalInstance)
 {
     base.AddObject("LogicalInstances", logicalInstance);
 }