我有一个从接口Letters
继承的类IA
,并且IA
从接口IB
继承。如何使用roslyn获得IA
和IB
接口? (我有ClassDeclarationSyntax
)
public interface IB
{
}
public interface IA : IB
{
}
public class Letters:IA
{
}
尝试类似的东西,
var interFacesOfLetters = typeof(Letters).GetInterfaces();
foreach (var x in interFacesOfLetters)
{
Console.WriteLine(x.Name);
}