How to use an alias type as a generic type parameter in C# -


this question has answer here:

how pass alias type defined using generic class?

i tried following code:

using id = int32; // might replaced `string`. using cc = c<id>;  public class c<t> {     t id; } 

and there error:

error cs0246 type or namespace name 'id' not found (are missing using directive or assembly reference?)

but using directive right above line error occurs. did miss something?

i not know trying achieve this, can, however, similar inheritance

public class cc : c<id> { } 

the class cc derive c<t> concrete type. hence cc.t of type int32 (or whatever).


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -