{
"/accruals/*": "/$1",
"/accruals?$inlinecount=allpages": "/accrualswithcount"
}
|
{
"accruals": [
{
"NMI": "1234567890",
. . .
},
{
"NMI": "2265786901",
. .
}
],
"accrualswithcount":{
"Items": [
{
"NMI": "1234567890",
"Site": "Airport",
. . . . .. . .
},
{
"NMI": "2265786901",
. . . . .
}
],
"Count": 2
}
}
|
<EjsDataManager @ref="DataManager" Url="https://mvc.syncfusion.com/Services/Northwnd.svc/Tasks/" Offline="true"></EjsDataManager>
<EjsChart DataSource="DataSource" id="container1">
<ChartPrimaryXAxis ValueType="Syncfusion.EJ2.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries Type="ChartSeriesType.Column" XName="Assignee" YName="Estimate" Query="@QueryData">
</ChartSeries>
</ChartSeriesCollection>
</EjsChart>
<EjsButton OnClick="@ChangeQuery">Change Query</EjsButton>
@code{
EjsDataManager DataManager;
public IEnumerable<Order> DataSource { get; set; } = new List<Order>();
public ChartSeries DefaultChartSeries = new ChartSeries();
public string QueryData = "new ej.data.Query().take(5).where('Estimate', 'lessThan', 1.5, false)";
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{ //provide generic type TValue
object data = await DataManager.ExecuteQuery<Order>(new Query());
DataSource = (data as IEnumerable).Cast<Order>().ToList();
StateHasChanged();
}
}
public class Order
{
public int? Id { get; set; }
. . . . .
}
} |