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?
where T: class
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.
Source: https://habr.com/ru/post/887835/More articles:What is a rule of thumb for increasing the number of links? - cHow can I make a word visible when opening a document through interaction? - c #Android - how to find the name of the main activity of the application? - androidGroovy as a list of questions - groovyHow to set a fixed height for my entire web page? - htmlIndividual form association? - phpuse KML, search for addresses, directions and a βcommon mapβ on one map - google-mapsExtJS How to add a click event for chart fragments - extjs4NHibernate QueryOver - distinctIs it possible to change the class name of an error when checking jQuery? - jqueryAll Articles