【发布时间】:2020-09-08 08:33:50
【问题描述】:
我正在自定义 DevExtreme 中数据网格所需的列。下面是我的 Index.cshtml 和加载数据的操作方法。该模型具有更多属性,但我只想包括这三个。
@(Html.DevExtreme().DataGrid<ServicingRequestOrder.Models.GeneralInfo>
()
.ID("dataGrid")
.ShowBorders(true)
.DataSource(d => d.Mvc().Controller("GeneralInfo").LoadAction("IndexLoad").Key("ID"))
.Columns(columns =>
{
columns.AddFor(m => m.CustomerID);
columns.AddFor(m => m.Name);
columns.AddFor(m => m.Description);
}).
[HttpGet]
public object IndexLoad(DataSourceLoadOptions loadOptions)
{
var generalInfos = _context.GeneralInfos.ToList();
return DataSourceLoader.Load(generalInfos, loadOptions);
}
我得到的具体例外是
TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ExpressionHelper' from assembly 'Microsoft.AspNetCore.Mvc.ViewFeatures, Version=3.1.7.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
我也在我的 Startup.cs 中包含了这项服务。
services.AddMvc().AddJsonOptions(options => options.JsonSerializerOptions.PropertyNamingPolicy = null);
我在这里错过了什么。
【问题讨论】:
标签: asp.net-core devexpress devextreme