Horje
check property type of collection c# Code Example
check property type of collection c#
var obj = new PropClassDemo();
foreach (PropertyInfo prop in obj.GetType().GetProperties())
{
	if(prop.PropertyType != typeof(string) && typeof(IEnumerable).IsAssignableFrom(prop.PropertyType))
	{
		Console.Writeline("This prop's type is Ienumerable");
	}
}

//Note: string is an ienumerable too




Csharp

Related
generate random dark colors programatically in android Code Example generate random dark colors programatically in android Code Example
c# increase length of array Code Example c# increase length of array Code Example
httpcontext.current.session null c# in class library Code Example httpcontext.current.session null c# in class library Code Example
casting in c# Code Example casting in c# Code Example
c# field vs property Code Example c# field vs property Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10