Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forward generic type definition

Tags:

c#

.net

generics

I'm forwarding type definitions for our legacy support. I'm using following syntax to do so:

[assembly: TypeForwardedTo(typeof(NamespaceA.TypeA))]

problem I'm having is that I can't find correct syntax for generic type definitions (it should be possible based on Eric Lippert's post and many other places).

What I would expect as working solution is

[assembly: TypeForwardedTo(typeof(NamespaceA.TypeA<T>))]

Any idea how write that correctly please? Thanks.

like image 336
Jaroslav Kadlec Avatar asked Oct 30 '22 17:10

Jaroslav Kadlec


1 Answers

You can try like this:

[assembly: TypeForwardedTo(typeof(NamespaceA.TypeA<>))]
like image 138
Rahul Tripathi Avatar answered Nov 15 '22 04:11

Rahul Tripathi