dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.18k stars 5.84k forks source link

Return Generic Type #36439

Open KWodarczyk opened 11 months ago

KWodarczyk commented 11 months ago

Please add an example of returning a generic type (T) as it's not clear what it the base practice here ? Is using return (T) Convert.ChangeType(sometypeLocalVariable, typeof(T)); ok ?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

BillWagner commented 11 months ago

That's a great suggestion @KWodarczyk

I've added it to our backlog to address when we next update this article.

postmeback commented 9 months ago

I would like to contribute here.