My dilemma:
- I have a POCO: “ReportSource” that is generic.
- I have a user control wrapping up some report building logic.
- My user control defines a ReportSource property but it will ultimately be the job of the page that calls the user control to assign that ReportSource property.
How can I define the property in my user control without specifying a T? Btw, I tried (just for larks) to make the user control generic… That ended badly.
public ReportSource<T> ReportSource {get; set;}
(Note that I’ve tagged this as C# and VB.net… C# is my norm, but I’m having to deal w/ legacy… An answer in either is appreciated)
Could you move the
Tspecific logic inside a non-genericReportSource? This “delays” the need to specify T until the caller needsTspecifically or untilReportSourceneedsT. In other words,ReportSourcewill have generic methods takingTor would otherwise encapsulate or hideTaltogether.