Skip to content

Commit c3b3e30

Browse files
committed
Documentation(1023120): Updated sample and readME
1 parent cc25752 commit c3b3e30

11 files changed

Lines changed: 86 additions & 1037 deletions

File tree

Cascading-dropdown-remote-data/filter_core/.vs/config/applicationhost.config

Lines changed: 0 additions & 990 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Cascading-dropdown-remote-data/filter_core/filter_core/Controllers/HomeController.cs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Microsoft.AspNetCore.Mvc;
77
using filter_core.Models;
88
using Syncfusion.EJ2.Base;
9+
using System.Text.Json;
910

1011
namespace TestSample.Controllers
1112
{
@@ -21,27 +22,30 @@ public IActionResult Index()
2122
ViewBag.DataSource = Order;
2223

2324
return View();
24-
}
25+
}
2526

26-
27-
public IActionResult StateDataSource([FromBody]ExtendedDataManager dm)
28-
{
27+
public IActionResult StateDataSource([FromBody] ExtendedDataManager dm)
28+
{
29+
var states = States.getStates();
2930

30-
var state = States.getStates();
31-
32-
var Data = state.ToList();
33-
int count = state.Count();
31+
int countryId = 0;
3432

33+
if (dm.Where != null && dm.Where.Count > 0)
34+
{
35+
var jsonValue = (JsonElement)dm.Where[0].value;
3536

36-
List<States> iterateState= new List<States>();
37-
foreach (States st in state) {
38-
if (st.countryId == (Int64)dm.Where[0].value) {
39-
iterateState.Add(st);
40-
}
41-
}
42-
return dm.RequiresCounts ? Json(new { result = Data.Skip(dm.Skip).Take(dm.Take), count = count }) : Json(iterateState.ToList());
37+
if (jsonValue.ValueKind == JsonValueKind.Number)
38+
{
39+
countryId = jsonValue.GetInt32(); // or GetInt64()
4340
}
41+
}
4442

43+
var filteredStates = states
44+
.Where(st => st.countryId == countryId)
45+
.ToList();
46+
47+
return Json(filteredStates);
48+
}
4549
public IActionResult CountryDataSource([FromBody]ExtendedDataManager dm)
4650
{
4751

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
5-
using Microsoft.AspNetCore.Builder;
1+
using Microsoft.AspNetCore.Builder;
62
using Microsoft.AspNetCore.Hosting;
73
using Microsoft.Extensions.Configuration;
84
using Microsoft.Extensions.DependencyInjection;
5+
using Microsoft.Extensions.Hosting;
96

107
namespace filter_core
118
{
@@ -18,33 +15,35 @@ public Startup(IConfiguration configuration)
1815

1916
public IConfiguration Configuration { get; }
2017

21-
// This method gets called by the runtime. Use this method to add services to the container.
18+
// Register services
2219
public void ConfigureServices(IServiceCollection services)
2320
{
24-
services.AddMvc();
21+
services.AddControllersWithViews();
2522
}
2623

27-
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
28-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
24+
// Configure HTTP request pipeline
25+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
2926
{
3027
if (env.IsDevelopment())
3128
{
32-
app.UseBrowserLink();
3329
app.UseDeveloperExceptionPage();
3430
}
3531
else
3632
{
3733
app.UseExceptionHandler("/Home/Error");
34+
app.UseHsts();
3835
}
3936

4037
app.UseStaticFiles();
4138

42-
app.UseMvc(routes =>
39+
app.UseRouting();
40+
41+
app.UseEndpoints(endpoints =>
4342
{
44-
routes.MapRoute(
43+
endpoints.MapControllerRoute(
4544
name: "default",
46-
template: "{controller=Home}/{action=Index}/{id?}");
45+
pattern: "{controller=Home}/{action=Index}/{id?}");
4746
});
4847
}
4948
}
50-
}
49+
}

Cascading-dropdown-remote-data/filter_core/filter_core/Views/Shared/_Layout.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>@ViewData["Title"] - filter_core</title>
77
@* Syncfusion Essential JS 2 Styles *@
8-
<link rel="stylesheet" href="https://cdn.syncfusion.com/ej2/material.css" />
8+
<link rel="stylesheet" href="https://cdn.syncfusion.com/ej2/33.1.44/material3.css" />
99

1010
@* Syncfusion Essential JS 2 Scripts *@
1111
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp8.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
9-
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="17.3.0.14" />
8+
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="33.1.44" />
109
</ItemGroup>
1110

12-
<ItemGroup>
13-
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
14-
</ItemGroup>
15-
16-
</Project>
11+
</Project>

0 commit comments

Comments
 (0)