private bool FilterParent(Company entity)
 {
     return (entity.Id == this.CompanyId);
 }
 private bool FilterChildren(Company entity)
 {
     return (entity.CompanyId == this.Id);
 }
 private void AttachChildren(Company entity)
 {
     entity.Parent = this;
 }
 private void DetachChildren(Company entity)
 {
     entity.Parent = null;
 }
 /// <summary>
 /// Create a new Company object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="createdBy">Initial value of the CreatedBy property.</param>
 /// <param name="createdDate">Initial value of the CreatedDate property.</param>
 /// <param name="companyId">Initial value of the CompanyId property.</param>
 public static Company CreateCompany(global::System.Int32 id, global::System.String createdBy, global::System.DateTime createdDate, global::System.Int32 companyId)
 {
     Company company = new Company();
     company.Id = id;
     company.CreatedBy = createdBy;
     company.CreatedDate = createdDate;
     company.CompanyId = companyId;
     return company;
 }