I'm newbie in R# API and I would ask you to help make my code better. Let's assume we have declaredType variable implementing IDeclaredType interface. How to check is declaredType actually representing List<Foo>, IList<Foo> or not?
My solution is:
ITypeElement element = declaredType.GetTypeElement();
string fullName = element.GetClrName().FullName;
bool isGenericList = fullName == "System.Collections.Generic.List`1"
|| fullName == "System.Collections.Generic.IList`1";
It works but looks bad! I'm sure a correct way to compare generic types exists in R# API instead of this string comparison. Any advice is appreciated!
ReSharper SDK 9.2 is used.