canton7
How to to dynamically provide T type of a generic method
The code which takes a Stream and a file type, gets the right sort of service to deal with that file type, gives it the stream, and gets back a set of DTOs which are specific to that file type
105 replies
How to to dynamically provide T type of a generic method
E.g. in a UI framework, you might have Button and TextBox which inherit from Control. Control exposes the general control-related stuff, but the only code which knows how to lay out and render a button is inside the Button class: that code can be called from anywhere, because the Layout and Render methods are on Control, and are non-generic, etc. You don't have a separate ButtonRenderer service and ButtonData DTO
105 replies
How to to dynamically provide T type of a generic method
I think you've been designing this entirely from the point of view of the data loading services. Switch it around, and figure out what the API should look like from the code which uses those services
105 replies
How to to dynamically provide T type of a generic method
In that case, isn't this exactly the problem we've been discussing already? If your
IDataLoadingInterface.ParseStreamIntoSystemDto
can return literally any type, with no constraints, then of course the calling code can't access that type in any meaningful way105 replies