private static OrganizationObject Convert2OrganizationObject(MembershipDataContext ctx, Organization org)
        {
            OrganizationObject organizationObject = new OrganizationObject()
            {
                ExtensionDataTypeId = org.ExtensionDataTypeId,
                OrganizationId = org.OrganizationId,
                OrganizationCode = org.OrganizationCode,
                OrganizationName = org.OrganizationName,
                OrganizationTypeId = org.OrganizationTypeId,
                Description = org.Description,
                Status = org.Status,
                CreatedBy = org.CreatedBy,
                CreatedDate = org.CreatedDate,
                LastUpdatedBy = org.LastUpdatedBy,
                LastUpdatedDate = org.LastUpdatedDate,
                ParentOrganizationId = org.ParentOrganizationId
            };

            foreach (OrganizationsInHierarchy organizationsInHierarchy in org.Hierarchies)
                organizationObject.Hierarchies[organizationsInHierarchy.HierarchyType] = organizationsInHierarchy.HierarchyDataId;

            organizationObject.ParseExtensionPropertiesFrom(org);
            return organizationObject;
        }
 partial void DeleteOrganization(Organization instance);
 partial void UpdateOrganization(Organization instance);
 partial void InsertOrganization(Organization instance);
		private void detach_Organizations(Organization entity)
		{
			this.SendPropertyChanging();
			entity.OrganizationType = null;
		}
		private void detach_Children(Organization entity)
		{
			this.SendPropertyChanging();
			entity.Parent = null;
		}