You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When making use of the functions provided by classes such as SymbolsFunctions in C# code we have to cast the type back to the original type to access additional properties on the objects.
// to get the list of all parameters that have the `FromRoute` attribute across all controllers you have to do something like this
classes
.ThatInheritFrom("ControllerBase").Cast<IClass>()// ThatInheritFrom returns a collection of ISymbolBase so we need to cast it back to IClass.SelectMany(controller => controller.Methods).SelectMany(method => method.Parameters.ThatHaveAttribute("FromRoute")).Cast<IParameter>()// ThatHaveAttribute returns a collection of ISymbolBase so we need to cast it back to IParameter
This should be relatively simple and low risk to implement. For example the following function WhereNamespaceStartsWith
If this was updated for all functions provided the example at the start of this issue would no longer need to cast the type back to the original type so it would be as follows
// to get the list of all parameters that have the `FromRoute` attribute across all controllers you can do this
classes
.ThatInheritFrom("ControllerBase").SelectMany(controller => controller.Methods).SelectMany(method => method.Parameters.ThatHaveAttribute("FromRoute"))
The text was updated successfully, but these errors were encountered:
When making use of the functions provided by classes such as
SymbolsFunctions
in C# code we have to cast the type back to the original type to access additional properties on the objects.This should be relatively simple and low risk to implement. For example the following function
WhereNamespaceStartsWith
Could be updated as follows
If this was updated for all functions provided the example at the start of this issue would no longer need to cast the type back to the original type so it would be as follows
The text was updated successfully, but these errors were encountered: