public static MainRecord ToEntity(this MainDto dto)
        {
            if (dto == null) return null;

            var entity = new MainRecord();

            entity.Id = dto.key;
            entity.ParentId = dto.parentId;
            entity.Title = dto.title;
            entity.MainTypeRecord = dto.mainType.ToEntity();

            dto.OnEntity(entity);

            return entity;
        }
partial         static void OnEntity(this MainDto dto, MainRecord entity);