Skip to content

Commit b8d77cb

Browse files
committed
update cs solution
1 parent 51317fc commit b8d77cb

16 files changed

+1237
-874
lines changed

CS/WebDashboardAspNetCore.sln

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.2.32516.85
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDashboardAspNetCore", "WebDashboardAspNetCore\WebDashboardAspNetCore.csproj", "{966BF9A7-C908-4E71-87D2-3AF486D7D380}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDashboardAspNetCore", "WebDashboardAspNetCore\WebDashboardAspNetCore.csproj", "{476E4744-2517-45CA-A94C-AAEA9A949FE9}"
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-
{966BF9A7-C908-4E71-87D2-3AF486D7D380}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{966BF9A7-C908-4E71-87D2-3AF486D7D380}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{966BF9A7-C908-4E71-87D2-3AF486D7D380}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{966BF9A7-C908-4E71-87D2-3AF486D7D380}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{476E4744-2517-45CA-A94C-AAEA9A949FE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{476E4744-2517-45CA-A94C-AAEA9A949FE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{476E4744-2517-45CA-A94C-AAEA9A949FE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{476E4744-2517-45CA-A94C-AAEA9A949FE9}.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 = {3E745CA4-B1FD-4343-968E-90B576A4A45E}
23+
SolutionGuid = {BE7ABFDC-23C2-4B43-A31D-BD67D96CEB94}
2424
EndGlobalSection
2525
EndGlobal

CS/WebDashboardAspNetCore/Code/DashboardUtils.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using DevExpress.DashboardAspNetCore;
2+
using DevExpress.DashboardCommon;
23
using DevExpress.DashboardWeb;
3-
using Microsoft.Extensions.Configuration;
4-
using Microsoft.Extensions.DependencyInjection;
4+
using DevExpress.DataAccess.Excel;
5+
using DevExpress.DataAccess.Sql;
56
using Microsoft.Extensions.FileProviders;
6-
using System;
77

88
namespace WebDashboardAspNetCore {
99
public static class DashboardUtils {
@@ -19,7 +19,7 @@ public static DashboardConfigurator CreateDashboardConfigurator(IConfiguration c
1919
// This method assigns the database schema provider to the Web Dashboard.
2020
// Uncomment one of the following lines depending on the provider.
2121
configurator.SetDBSchemaProvider(new ManualDBSchemaProvider());
22-
// configurator.SetDBSchemaProvider(new LimitDBSchemaProvider());
22+
//configurator.SetDBSchemaProvider(new LimitDBSchemaProvider());
2323

2424
return configurator;
2525
}

CS/WebDashboardAspNetCore/Controllers/DefaultDashboardController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace WebDashboardAspNetCore.Controllers {
66
public class DefaultDashboardController : DashboardController {
7-
public DefaultDashboardController(DashboardConfigurator configurator, IDataProtectionProvider dataProtectionProvider = null)
7+
public DefaultDashboardController(DashboardConfigurator configurator, IDataProtectionProvider? dataProtectionProvider = null)
88
: base(configurator, dataProtectionProvider) {
99
}
1010
}
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dashboard>
3-
<Title Text="New Dashboard" />
4-
<DataSources>
5-
<SqlDataSource Name="Categories" ComponentName="sqlDataSource1">
6-
<Connection Name="NWindConnectionString" FromAppConfig="true" />
7-
<Query Type="SelectQuery" Name="Categories">
8-
<Tables>
9-
<Table Name="Categories" />
10-
</Tables>
11-
<Columns>
12-
<Column Table="Categories" Name="CategoryID" />
13-
<Column Table="Categories" Name="CategoryName" />
14-
</Columns>
15-
</Query>
16-
<ConnectionOptions CloseConnection="true" />
17-
</SqlDataSource>
18-
</DataSources>
3+
<Title Text="New Dashboard" />
4+
<DataSources>
5+
<SqlDataSource Name="Categories" ComponentName="sqlDataSource1">
6+
<Connection Name="NWindConnectionString" FromAppConfig="true" />
7+
<Query Type="SelectQuery" Name="Categories">
8+
<Tables>
9+
<Table Name="Categories" />
10+
</Tables>
11+
<Columns>
12+
<Column Table="Categories" Name="CategoryID" />
13+
<Column Table="Categories" Name="CategoryName" />
14+
</Columns>
15+
</Query>
16+
<ConnectionOptions CloseConnection="true" />
17+
</SqlDataSource>
18+
</DataSources>
1919
</Dashboard>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="DevExpress-Local" value="C:\Program Files (x86)\DevExpress 21.2\Components\System\Components\packages" />
4+
<add key="DevExpress-Local" value="C:\Program Files\DevExpress 22.1\Components\System\Components\packages" />
55
</packageSources>
66
</configuration>

CS/WebDashboardAspNetCore/Program.cs

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,44 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
5-
using Microsoft.AspNetCore.Hosting;
6-
using Microsoft.Extensions.Configuration;
7-
using Microsoft.Extensions.Hosting;
8-
using Microsoft.Extensions.Logging;
9-
10-
namespace WebDashboardAspNetCore
1+
using DevExpress.AspNetCore;
2+
using DevExpress.DashboardAspNetCore;
3+
using DevExpress.DashboardWeb;
4+
using Microsoft.Extensions.FileProviders;
5+
using WebDashboardAspNetCore;
6+
7+
var builder = WebApplication.CreateBuilder(args);
8+
9+
IFileProvider? fileProvider = builder.Environment.ContentRootFileProvider;
10+
IConfiguration? configuration = builder.Configuration;
11+
12+
// Add services to the container.
13+
builder.Services.AddControllersWithViews();
14+
builder.Services.AddRazorPages();
15+
16+
builder.Services.AddDevExpressControls();
17+
builder.Services.AddScoped<DashboardConfigurator>((IServiceProvider serviceProvider) => {
18+
return DashboardUtils.CreateDashboardConfigurator(configuration, fileProvider);
19+
});
20+
21+
var app = builder.Build();
22+
23+
24+
// Configure the HTTP request pipeline.
25+
if (!app.Environment.IsDevelopment())
1126
{
12-
public class Program
13-
{
14-
public static void Main(string[] args)
15-
{
16-
CreateHostBuilder(args).Build().Run();
17-
}
18-
19-
public static IHostBuilder CreateHostBuilder(string[] args) =>
20-
Host.CreateDefaultBuilder(args)
21-
.ConfigureWebHostDefaults(webBuilder => {
22-
webBuilder.UseStartup<Startup>();
23-
});
24-
}
25-
}
27+
app.UseExceptionHandler("/Home/Error");
28+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
29+
app.UseHsts();
30+
}
31+
32+
app.UseHttpsRedirection();
33+
app.UseStaticFiles();
34+
35+
app.UseDevExpressControls();
36+
37+
app.UseRouting();
38+
39+
app.UseAuthorization();
40+
app.MapRazorPages();
41+
42+
EndpointRouteBuilderExtension.MapDashboardRoute(app, "dashboardControl", "DefaultDashboard");
43+
44+
app.Run();

CS/WebDashboardAspNetCore/WebDashboardAspNetCore.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk.Web">
33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
5+
6+
<Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings>
57

68
</PropertyGroup>
79
<ItemGroup>
810

9-
<PackageReference Include="DevExpress.AspNetCore.Dashboard" Version="21.2.8" /><PackageReference Include="System.Data.SQLite.Core" Version="1.0.115.5" /><PackageReference Include="BuildBundlerMinifier" Version="3.2.449" /><PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.113" /></ItemGroup>
11+
<PackageReference Include="DevExpress.AspNetCore.Dashboard" Version="22.1.5" /><PackageReference Include="System.Data.SQLite.Core" Version="1.0.115.5" /><PackageReference Include="BuildBundlerMinifier" Version="3.2.449" /><PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.113" /></ItemGroup>
1012
<ItemGroup>
1113
<Compile Remove="node_modules\**" />
1214
<Content Remove="node_modules\**" />
1315
<EmbeddedResource Remove="node_modules\**" />
1416
<None Remove="node_modules\**" />
1517
</ItemGroup>
16-
<ItemGroup>
17-
<Folder Include="Data\Dashboards\" />
18-
</ItemGroup>
1918
<Target Name="DebugEnsureNodeEnv" BeforeTargets="LibraryManagerRestore" Condition=" '$(Configuration)' == 'Debug' And !Exists('node_modules') ">
2019
<!-- Ensure Node.js is installed -->
2120
<Exec Command="node --version" ContinueOnError="true">
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
{
1+
{
22
"Logging": {
3-
"IncludeScopes": false,
43
"LogLevel": {
5-
"Default": "Debug",
6-
"System": "Information",
7-
"Microsoft": "Information"
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
86
}
97
}
108
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"Logging": {
3-
"IncludeScopes": false,
43
"LogLevel": {
5-
"Default": "Warning"
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
66
}
77
},
8+
"AllowedHosts": "*",
89
"ConnectionStrings": {
910
"NWindConnectionString": "XpoProvider=SQLite;Data Source=Data/nwind.db"
1011
}
11-
}
12+
}

0 commit comments

Comments
 (0)