次の宣言があります。
public static class Helper
{
public static Func<T1,T2, string> myFunc = (t1, t2) =>
{
var result = string.Empty
//do some things with params t1 and t2, and build a string
return result
};
}
そして、私はそれを次のように消費しています:
var myString = Helper.myFunc(t1, t2);
別のクラスで。コンパイルされず、「一貫性のないアクセシビリティ: フィールド タイプ ... は、フィールド Helper.myFunc よりもアクセスしにくい」と表示されます。