Skip to content

Commit b82f64b

Browse files
committed
Add sentry
1 parent a1b94fa commit b82f64b

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

WebPerformanceCalculator/Controllers/ApiController.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
using System;
3-
using System.Collections.Generic;
43
using System.Linq;
54
using System.Threading.Tasks;
65
using AutoMapper;
@@ -255,7 +254,5 @@ private string FixupSort(string? sort)
255254
_ => "LocalPp"
256255
};
257256
}
258-
259-
260257
}
261258
}
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
using System.IO;
2+
using Microsoft.AspNetCore;
13
using Microsoft.AspNetCore.Hosting;
2-
using Microsoft.Extensions.Hosting;
4+
using Microsoft.Extensions.Configuration;
35

46
namespace WebPerformanceCalculator
57
{
@@ -10,13 +12,18 @@ public static void Main(string[] args)
1012
CreateHostBuilder(args).Build().Run();
1113
}
1214

13-
public static IHostBuilder CreateHostBuilder(string[] args)
15+
public static IConfiguration Configuration { get; private set; } = new ConfigurationBuilder()
16+
.SetBasePath(Directory.GetCurrentDirectory())
17+
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
18+
.AddEnvironmentVariables()
19+
.Build();
20+
21+
public static IWebHostBuilder CreateHostBuilder(string[] args)
1422
{
15-
return Host.CreateDefaultBuilder(args)
16-
.ConfigureWebHostDefaults(webBuilder =>
17-
{
18-
webBuilder.UseStartup<Startup>();
19-
});
23+
return WebHost.CreateDefaultBuilder(args)
24+
.UseConfiguration(Configuration)
25+
.UseSentry()
26+
.UseStartup<Startup>();
2027
}
2128
}
2229
}

WebPerformanceCalculator/WebPerformanceCalculator.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
<ItemGroup>
1010
<PackageReference Include="AutoMapper" Version="10.1.1" />
1111
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.4" />
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.4">
12+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.6" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.6">
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
</PackageReference>
1717
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1818
<PackageReference Include="RunProcessAsTask" Version="1.2.4" />
19+
<PackageReference Include="Sentry.AspNetCore" Version="3.3.4" />
1920
<PackageReference Include="System.Runtime.Caching" Version="5.0.0" />
2021
</ItemGroup>
2122

0 commit comments

Comments
 (0)