Is there a way to restrict the generic parameter type to an anonymous type?

Is there a way to limit the generic parameter type to an anonymous type in C # 4.0? Or where T: class closest I will come?

+6
source share
1 answer

No, there are no such restrictions in C #. You can add an execution check to verify that the type of the characteristic is an anonymous type , though.

+6
source

Source: https://habr.com/ru/post/887835/


All Articles