I would like to make a new Structure Group when we create a new Folder. In older versions of Tridion we might do this with the TDSE object.
I'm on Tridion Sites 9 and wanted to use something similar and tried with the following code.
StructureGroup newSg = (StructureGroup) session.GetNewObject();
Error CS0311 The type 'Tridion.ContentManager.CommunicationManagement.StructureGroup' cannot be used as type parameter 'T' in the generic type or method 'Session.GetNewObject()'. There is no implicit reference conversion from 'Tridion.ContentManager.CommunicationManagement.StructureGroup' to 'Tridion.ContentManager.SystemWideObject'.
Is my only option here to use the Tridion Core Service?