我有以下声明:
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更难访问”--我知道这与匿名声明有关,但如何解决呢?
发布于 2016-11-01 08:00:03
检查T1和T2是否也可在此代码中访问
var myString = Helper.myFunc(t1, t2);https://stackoverflow.com/questions/40356061
复制相似问题