System.TypeExtensions.ResultType C# (CSharp) Method

ResultType() public static method

public static ResultType ( this memberInfo ) : Type
memberInfo this
return Type
		public static Type ResultType(this MemberInfo memberInfo)
		{
			var resultType = memberInfo.MaybeAs<PropertyInfo>().Select(x => x.PropertyType)
				.OrElse(() => memberInfo.MaybeAs<MethodInfo>().Select(x => x.ReturnType))
				.OrElse(() => memberInfo.MaybeAs<FieldInfo>().Select(x => x.FieldType)).Value;
			return resultType;
		}