[RESOLVED] LINQ, oh the joy.
Code:
private IEnumerable<string> GetAllInterfaces(Type[] interfaces)
{
// Todo:
// The GetAllInterfaces method of the TypeWriter class returns a strongly
// typed IEnumerable of strings containing the Name property of each of the
// interfaces types contained in the interfaces parameter.
return from interfaces in typeof(string).GetProperties()
where interfaces.Name == typeof(string)
select interfaces;
}
VS2008, 3.5.
I took a crack at the Todo and am completely off. Guidance please?
Re: [RESOLVED] LINQ, oh the joy.
I would do it like this..
Code:
private IEnumerable<string> GetAllMembers(Type type)
{
from memberInfo in type.GetMembers()
order by memberInfo.GetType().ToString()
select String.Format("{0} {1}", memberInfo.GetType().ToString(), memberInfo.ToString())
}
The description could have been clearer. I'm not sure if they member signature and member name mean the same thing...
I saw your post after I'd put mine. I don't need the GetType().ToString() after all...I'm glad you figured it out.