6
6
using DevExpress . DataAccess . EntityFramework ;
7
7
using DevExpress . DataAccess . Excel ;
8
8
using DevExpress . DataAccess . Json ;
9
- using DevExpress . DataAccess . ObjectBinding ;
10
9
using DevExpress . DataAccess . Sql ;
11
10
using Microsoft . AspNetCore . Builder ;
12
11
using Microsoft . AspNetCore . Hosting ;
13
12
using Microsoft . Extensions . Configuration ;
14
13
using Microsoft . Extensions . DependencyInjection ;
15
14
using Microsoft . Extensions . FileProviders ;
15
+ using Microsoft . Extensions . Hosting ;
16
16
using System ;
17
17
18
18
namespace WebDashboardDataSources {
19
19
public class Startup {
20
- public Startup ( IConfiguration configuration , IHostingEnvironment hostingEnvironment ) {
20
+ public Startup ( IConfiguration configuration , IWebHostEnvironment hostingEnvironment ) {
21
21
Configuration = configuration ;
22
22
FileProvider = hostingEnvironment . ContentRootFileProvider ;
23
23
DashboardExportSettings . CompatibilityMode = DashboardExportCompatibilityMode . Restricted ;
@@ -140,7 +140,7 @@ private void Configurator_ConfigureDataConnection(object sender, ConfigureDataCo
140
140
}
141
141
142
142
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
143
- public void Configure ( IApplicationBuilder app , IHostingEnvironment env ) {
143
+ public void Configure ( IApplicationBuilder app , IWebHostEnvironment env ) {
144
144
app . UseDevExpressControls ( ) ;
145
145
if ( env . IsDevelopment ( ) ) {
146
146
app . UseDeveloperExceptionPage ( ) ;
@@ -149,11 +149,14 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env) {
149
149
app . UseExceptionHandler ( "/Home/Error" ) ;
150
150
}
151
151
app . UseStaticFiles ( ) ;
152
- app . UseMvc ( routes => {
153
- routes . MapDashboardRoute ( ) ;
154
- routes . MapRoute (
152
+ app . UseRouting ( ) ;
153
+ app . UseEndpoints ( endpoints => {
154
+ // Map dashboard routes.
155
+ EndpointRouteBuilderExtension . MapDashboardRoute ( endpoints , "api/dashboard" ) ;
156
+ endpoints . MapControllerRoute (
155
157
name : "default" ,
156
- template : "{controller=Home}/{action=Index}/{id?}" ) ;
158
+ pattern : "{controller=Home}/{action=Index}/{id?}" ) ;
159
+ endpoints . MapRazorPages ( ) ;
157
160
} ) ;
158
161
}
159
162
}
0 commit comments