c# - 错误: Cannot convert lambda expression to type 'bool' because it is not a delegate type in Kendo Chart

标签 c# asp.net-mvc lambda kendo-chart

我正在为 Kendo 图表标签做一些流畅的标记:

.Labels(x =>
    x.DateFormats(formats =>
        formats
        .Days(MyFormat.DateReportByDay)
        .Months(MyFormat.DateReportByMonth))
     .Culture(Thread.CurrentThread.CurrentCulture)

我收到此错误:

Compiler Error Message: CS1660: Cannot convert lambda expression to type 'bool' because it is not a delegate type

但是如果我使用这段代码:

.Labels(x =>
    x.DateFormats(formats =>
        formats
        .Days("dd")
        .Months("MMM yy"))
     .Culture(Thread.CurrentThread.CurrentCulture)

效果很好。我对格式变量的定义是

public static class MyFormat
{
    public const string DateReportByMonth = "MMM yy";
    public static string DateReportByDay = "dd";
}

它说我不能使用字符串常量代替字符串?这太疯狂了!

最佳答案

嗯,看起来@Didaxis 是对的,我进行了重建,它似乎已修复。奇怪。

关于c# - 错误: Cannot convert lambda expression to type 'bool' because it is not a delegate type in Kendo Chart,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28597827/

相关文章:

c# - 当我进行提交时标记以排除文件的一部分?

c# - 无法加载文件或程序集 'itextsharp' 或其依赖项之一

javascript - MVC Core 在客户端添加多个表/表单,如何从服务器端检索数据

c# - “模型”与声明“System.Web.Mvc.WebViewPage<TModel>.Model”冲突

java - Lambda Java 8 - 如何在将字符串列表流式传输到日期列表时进行转换

c# - Windows 10 通用应用程序文件/目录访问

c# - 检测圆 A 是否完全在圆 B 内

asp.net-mvc - 使用 AutoMapper 对 Controller 进行单元测试

c++ - 如何从捕获移动的lambda表达式中创建std::function?

Java 8 - 与匿名类不同,不会为 lambda 创建新对象