/// <summary>
        /// Converts this instance of <see cref="datahierarchy"/> to an instance of <see cref="datahierarchyDto"/>.
        /// </summary>
        /// <param name="entity"><see cref="datahierarchy"/> to convert.</param>
        public static datahierarchyDto ToDTO(this datahierarchy entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new datahierarchyDto();

            dto.i_GroupId         = entity.i_GroupId;
            dto.i_ItemId          = entity.i_ItemId;
            dto.v_Value1          = entity.v_Value1;
            dto.v_Value2          = entity.v_Value2;
            dto.v_Field           = entity.v_Field;
            dto.i_ParentItemId    = entity.i_ParentItemId;
            dto.i_Sort            = entity.i_Sort;
            dto.i_IsDeleted       = entity.i_IsDeleted;
            dto.i_InsertUserId    = entity.i_InsertUserId;
            dto.d_InsertDate      = entity.d_InsertDate;
            dto.i_UpdateUserId    = entity.i_UpdateUserId;
            dto.d_UpdateDate      = entity.d_UpdateDate;
            dto.v_ComentaryUpdate = entity.v_ComentaryUpdate;

            entity.OnDTO(dto);

            return(dto);
        }