0
我的問題是將json列表推向javascript代碼中的C#對象列表。我如何將$ scope.items推入CustomColumns? requestData.CustomColumns.push($ scope.items);不工作...我的C#模式是:如何將json數據通過javascript推送到csharp對象列表中?
public partial class WorkflowDefinitionDTO {
public List<WorkflowDefinitionCustomColumnDTO> CustomColumns { get; set; }
}
public partial class WorkflowDefinitionCustomColumnDTO {
public string Name { get; set; }
public int Type { get; set; }
public string Format { get; set; }
public decimal MinValue { get; set; }
public decimal MaxValue { get; set; }
public string DefaultValue { get; set; }
public int Visibility { get; set; }
public int Requirements { get; set; }
public List<string> SelectTypeValues { get; set; }
}
我的推送數據的JavaScript代碼:
var requestData = {
CustomColumns: []
};
requestData.CustomColumns.push($scope.items);
$ scope.items低於:
$scope.items.push({
Type: result.FieldType.value, Name: result.CustomFieldName, Format: "", MinValue: 0, MaxValue: 1000,
DefaultValue: result.DefaultValue, Visibility: 1, Requirements: 0, CanBeChangebleOk: result.CanBeChangebleOk.value
});
你想你的數據發送到一個MVC控制器? – Andrei
是的。我想將您的數據發送到MVC控制器 – Penguen