First of all read about new conversion workflow in ECS:
And read about Parent IComponentData in docs or just look at source code