Skip to content

Commit 9663c91

Browse files
authored
added the startup.cs file with license key code changes
1 parent 495fb5e commit 9663c91

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

Startup.cs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Builder;
6+
using Microsoft.AspNetCore.Components;
7+
using Microsoft.AspNetCore.Hosting;
8+
using Microsoft.AspNetCore.HttpsPolicy;
9+
using Microsoft.Extensions.Configuration;
10+
using Microsoft.Extensions.DependencyInjection;
11+
using Microsoft.Extensions.Hosting;
12+
using column_charts.Data;
13+
using Syncfusion.EJ2.Blazor;
14+
15+
namespace column_charts
16+
{
17+
public class Startup
18+
{
19+
public Startup(IConfiguration configuration)
20+
{
21+
Configuration = configuration;
22+
}
23+
24+
public IConfiguration Configuration { get; }
25+
26+
// This method gets called by the runtime. Use this method to add services to the container.
27+
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
28+
public void ConfigureServices(IServiceCollection services)
29+
{
30+
services.AddRazorPages();
31+
services.AddServerSideBlazor();
32+
services.AddSingleton<WeatherForecastService>();
33+
services.AddSyncfusionBlazor();
34+
}
35+
36+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
37+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
38+
{
39+
// Add your valid license key here.
40+
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("Your License Key");
41+
if (env.IsDevelopment())
42+
{
43+
app.UseDeveloperExceptionPage();
44+
}
45+
else
46+
{
47+
app.UseExceptionHandler("/Error");
48+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
49+
app.UseHsts();
50+
}
51+
52+
app.UseHttpsRedirection();
53+
app.UseStaticFiles();
54+
55+
app.UseRouting();
56+
57+
app.UseEndpoints(endpoints =>
58+
{
59+
endpoints.MapBlazorHub();
60+
endpoints.MapFallbackToPage("/_Host");
61+
});
62+
}
63+
}
64+
}

0 commit comments

Comments
 (0)