public void InsertSqlResource(SqlResource sqlResource)
 {
     if ((sqlResource.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(sqlResource, EntityState.Added);
     }
     else
     {
         this.ObjectContext.SqlResources.AddObject(sqlResource);
     }
 }
 public void DeleteSqlResource(SqlResource sqlResource)
 {
     if ((sqlResource.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(sqlResource, EntityState.Deleted);
     }
     else
     {
         this.ObjectContext.SqlResources.Attach(sqlResource);
         this.ObjectContext.SqlResources.DeleteObject(sqlResource);
     }
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the SqlResources EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSqlResources(SqlResource sqlResource)
 {
     base.AddObject("SqlResources", sqlResource);
 }
 /// <summary>
 /// Create a new SqlResource object.
 /// </summary>
 /// <param name="sqlResourceId">Initial value of the SqlResourceId property.</param>
 public static SqlResource CreateSqlResource(global::System.Int32 sqlResourceId)
 {
     SqlResource sqlResource = new SqlResource();
     sqlResource.SqlResourceId = sqlResourceId;
     return sqlResource;
 }
 private bool FilterSqlResources(SqlResource entity)
 {
     return (entity.SqlResourceTypeId == this.SqlResourceTypeId);
 }
 private void DetachSqlResources(SqlResource entity)
 {
     entity.SqlResourceType = null;
 }
 private void AttachSqlResources(SqlResource entity)
 {
     entity.SqlResourceType = this;
 }
 public void UpdateSqlResource(SqlResource currentSqlResource)
 {
     this.ObjectContext.SqlResources.AttachAsModified(currentSqlResource);
 }