static Expression ExampleCondition(MetadataContext cx) { var thread = TypeSignature.FromType(typeof(System.Threading.Thread)).NotGeneric(); var currentThread = cx.GetMemberProperty(thread, "CurrentThread").Getter(); var isBackground = cx.GetMemberProperty(((TypeReference.SpecializedTypeCase)currentThread.ResultType()).Item, "IsBackground").Getter(); var condition = Expression.MethodCall(isBackground, ImmutableArray <Expression> .Empty, Expression.MethodCall(currentThread, ImmutableArray <Expression> .Empty, null)); return(condition); }