예제 #1
0
 public void DeleteGraphicInstance(GraphicInstance graphicInstance)
 {
     if ((graphicInstance.EntityState == EntityState.Detached))
     {
         this.ObjectContext.GraphicInstances.Attach(graphicInstance);
     }
     this.ObjectContext.GraphicInstances.DeleteObject(graphicInstance);
 }
예제 #2
0
        /// <summary>
        /// Create a new GraphicInstance object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="logicalInstanceId">Initial value of the LogicalInstanceId property.</param>
        public static GraphicInstance CreateGraphicInstance(global::System.Int32 id, global::System.Int32 logicalInstanceId)
        {
            GraphicInstance graphicInstance = new GraphicInstance();

            graphicInstance.Id = id;
            graphicInstance.LogicalInstanceId = logicalInstanceId;
            return(graphicInstance);
        }
예제 #3
0
 public void InsertGraphicInstance(GraphicInstance graphicInstance)
 {
     if ((graphicInstance.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(graphicInstance, EntityState.Added);
     }
     else
     {
         this.ObjectContext.GraphicInstances.AddObject(graphicInstance);
     }
 }
예제 #4
0
 public void UpdateGraphicInstance(GraphicInstance currentGraphicInstance)
 {
     this.ObjectContext.GraphicInstances.AttachAsModified(currentGraphicInstance, this.ChangeSet.GetOriginal(currentGraphicInstance));
 }
예제 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the GraphicInstances EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGraphicInstances(GraphicInstance graphicInstance)
 {
     base.AddObject("GraphicInstances", graphicInstance);
 }