Skip to content

Commit e3bfdf9

Browse files
Merge pull request #3 from DevExpress-Examples/fixingExample_25.1.3+
Fixing Example: Convert to 25.1.3+ example template
2 parents c1dd1ac + 49fdc31 commit e3bfdf9

File tree

89 files changed

+16226
-16860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+16226
-16860
lines changed

ASP.NET Core/ASP.NET Core.csproj

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
</PropertyGroup>
67

7-
<Target Name="DebugEnsureNodeEnv" BeforeTargets="BeforeBuild" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
8-
<!-- Ensure Node.js is installed -->
9-
<Exec Command="node --version" ContinueOnError="true">
10-
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
11-
</Exec>
12-
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
13-
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
14-
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
15-
</Target>
16-
<Target Name="RunGulp" BeforeTargets="BeforeBuild" Condition=" '$(Configuration)' == 'Debug' And Exists('$(SpaRoot)node_modules') ">
17-
<Exec WorkingDirectory="$(ProjectDir)" Command="node_modules\.bin\gulp add-resources" ContinueOnError="false">
18-
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
19-
</Exec>
20-
</Target>
8+
<ItemGroup>
9+
<PackageReference Include="DevExtreme.AspNet.Data" Version="5.1.0" />
10+
<PackageReference Include="DevExtreme.AspNet.Core" Version="25.1.3" />
11+
</ItemGroup>
2112

22-
<ItemGroup>
23-
<PackageReference Include="DevExtreme.AspNet.Core" Version="25.1.*" />
24-
</ItemGroup>
13+
<ProjectExtensions><VisualStudio><UserProperties TemplateFeatures="NETCORE" /></VisualStudio></ProjectExtensions>
2514

2615
</Project>

ASP.NET Core/ASP.NET Core.sln

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30330.147
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36408.4 d17.14
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASP.NET Core", "ASP.NET Core.csproj", "{435CB7A8-3168-4BD2-815F-E54F708AF968}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASP.NET Core", "ASP.NET Core.csproj", "{31DAB6A2-0A52-DF9E-9C93-F3FDF4A1A357}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{435CB7A8-3168-4BD2-815F-E54F708AF968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{435CB7A8-3168-4BD2-815F-E54F708AF968}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{435CB7A8-3168-4BD2-815F-E54F708AF968}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{435CB7A8-3168-4BD2-815F-E54F708AF968}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{31DAB6A2-0A52-DF9E-9C93-F3FDF4A1A357}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{31DAB6A2-0A52-DF9E-9C93-F3FDF4A1A357}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{31DAB6A2-0A52-DF9E-9C93-F3FDF4A1A357}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{31DAB6A2-0A52-DF9E-9C93-F3FDF4A1A357}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {08AFB133-D1F6-4FE9-A66A-586B96B002D0}
23+
SolutionGuid = {ACEC7E14-6382-44B0-A7BF-7040D0D03F24}
2424
EndGlobalSection
2525
EndGlobal

ASP.NET Core/Controllers/orig_DnDBetweenGridsController.cs renamed to ASP.NET Core/Controllers/DnDBetweenGridsController.cs

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
using ASP.NET_Core.Models;
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using System.Text.Json;
4+
using ASP.NET_Core.Models;
25
using ASP_NET_Core.Models;
36
using DevExtreme.AspNet.Data;
47
using DevExtreme.AspNet.Mvc;
58
using Microsoft.AspNetCore.Http;
69
using Microsoft.AspNetCore.Mvc;
710
using Microsoft.Extensions.Caching.Memory;
8-
using Newtonsoft.Json;
9-
using System.Linq;
1011

11-
namespace ASP.NET_Core.Controllers {
12+
namespace ASP.NET_Core.Controllers
13+
{
1214
[Route("api/[controller]/[action]")]
1315
public class DnDBetweenGridsController : Controller
1416
{
@@ -29,7 +31,32 @@ public object Tasks(DataSourceLoadOptions loadOptions)
2931
public IActionResult UpdateTask(int key, string values)
3032
{
3133
var order = _context.Tasks.First(o => o.ID == key);
32-
JsonConvert.PopulateObject(values, order);
34+
35+
var updates = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(values);
36+
foreach (var property in updates)
37+
{
38+
switch (property.Key)
39+
{
40+
case "Subject":
41+
order.Subject = property.Value.GetString();
42+
break;
43+
case "Status":
44+
order.Status = property.Value.GetInt32();
45+
break;
46+
case "Owner":
47+
order.Owner = property.Value.GetInt32();
48+
break;
49+
case "AssignedEmployee":
50+
order.AssignedEmployee = property.Value.GetInt32();
51+
break;
52+
case "Priority":
53+
order.Priority = property.Value.GetInt32();
54+
break;
55+
case "OrderIndex":
56+
order.OrderIndex = property.Value.GetInt32();
57+
break;
58+
}
59+
}
3360

3461
if (!TryValidateModel(order))
3562
return BadRequest(ModelState.GetFullErrorMessage());

ASP.NET Core/Controllers/SampleDataController.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

ASP.NET Core/Controllers/orig_HomeController.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.
File renamed without changes.

ASP.NET Core/Models/orig_InMemoryDataContext.cs renamed to ASP.NET Core/Models/InMemoryDataContext.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNetCore.Http;
22
using Microsoft.Extensions.Caching.Memory;
3-
using Newtonsoft.Json;
3+
using System.Text.Json;
44
using System;
55
using System.Collections.Generic;
66
using System.Linq;
@@ -49,7 +49,8 @@ public void SaveChanges()
4949

5050
static ICollection<T> DeepClone(IEnumerable<T> source)
5151
{
52-
return JsonConvert.DeserializeObject<List<T>>(JsonConvert.SerializeObject(source));
52+
var json = JsonSerializer.Serialize(source);
53+
return JsonSerializer.Deserialize<List<T>>(json);
5354
}
5455
}
5556
}

ASP.NET Core/Models/orig_InMemoryRowReorderingTasksDataContext.cs renamed to ASP.NET Core/Models/InMemoryRowReorderingTasksDataContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ public class InMemoryRowReorderingTasksDataContext : InMemoryDataContext<RowReor
99
{
1010

1111
public InMemoryRowReorderingTasksDataContext(IHttpContextAccessor contextAccessor, IMemoryCache memoryCache)
12-
: base(contextAccessor, memoryCache) {
12+
: base(contextAccessor, memoryCache)
13+
{
1314
}
1415

1516
public ICollection<RowReorderingTask> Tasks => ItemsInternal;

ASP.NET Core/Models/orig_RowReorderingTask.cs renamed to ASP.NET Core/Models/RowReorderingTasks.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.ComponentModel.DataAnnotations;
22

3-
namespace ASP_NET_Core.Models {
3+
namespace ASP_NET_Core.Models
4+
{
45
public class RowReorderingTask
56
{
67
public int ID { set; get; }
@@ -15,4 +16,6 @@ public class RowReorderingTask
1516
public int OrderIndex { get; set; }
1617
public int Priority { get; set; }
1718
}
19+
20+
1821
}

0 commit comments

Comments
 (0)