Closed Xriuk closed 1 year ago
Type:
IList<MyClass> or IList<MyClass>?
the result is the same
AllInterfaces print:
[ICollection<MyClass>, IEnumerable<MyClass>, IEnumerable]
It returns false for IType.IsCollection but true for IType.IsEnumerable
false
IType.IsCollection
true
IType.IsEnumerable
I think here: https://github.com/NeVeSpl/NTypewriter/blob/96354ef3e5a38856e09daaccf417a44688f841bc/NTypewriter.CodeModel.Roslyn/Type.cs#L17 should become something like:
public bool IsCollection => symbol.AllInterfaces.Any(x => x.ToString() == "System.Collections.ICollection" || x.ToString().StartsWith("System.Collections.Generic.ICollection")) || this.FullName.StartsWith("System.Collections.Generic.ICollection") || this.FullName == "System.Collections.ICollection";
Indeed, you are right.
Type:
the result is the same
AllInterfaces print:
It returns
false
forIType.IsCollection
buttrue
forIType.IsEnumerable
I think here: https://github.com/NeVeSpl/NTypewriter/blob/96354ef3e5a38856e09daaccf417a44688f841bc/NTypewriter.CodeModel.Roslyn/Type.cs#L17 should become something like: