Skip to content

Commit

Permalink
Unhandled exception in db seeder
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonRun3s committed Jan 1, 2024
1 parent 91d0c59 commit 4f30fed
Show file tree
Hide file tree
Showing 12 changed files with 3,662 additions and 8 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace CWASP_Razor_Edition.Migrations
{
/// <inheritdoc />
public partial class Reset_Migration_DB_PostDrop : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{

}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{

}
}
}
2 changes: 1 addition & 1 deletion CWASP Razor Edition/Models/SeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void Initialize(IServiceProvider serviceProvider)
{
LoanerOTO = "OTO00513",
StudentName = "John Smith",
// Reason = new SelectListItem { Value = "Home", Text = "Home" },
Reason = "Other",
Description = "Description",
}
);
Expand Down
3 changes: 1 addition & 2 deletions CWASP Razor Edition/Pages/Delete.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

<h1>Delete</h1>

<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Ticket</h4>
<h4>Ticket @Model.Ticket.Id</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
Expand Down
2 changes: 1 addition & 1 deletion CWASP Razor Edition/Pages/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1>Details</h1>

<div>
<h4>Ticket</h4>
<h4>Ticket @Model.Ticket.Id</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
Expand Down
2 changes: 1 addition & 1 deletion CWASP Razor Edition/Pages/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<h1>Edit</h1>

<h4>Ticket</h4>
<h4>Ticket @Model.Ticket.Id</h4>
<hr />
<div class="row">
<div class="col-md-4">
Expand Down
2 changes: 1 addition & 1 deletion CWASP Razor Edition/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<form>
<p style="display:inline">
Loaner OTO: <input type="text" asp-for="SearchOTO" />
OTO #: <input type="text" asp-for="SearchOTO" />
Student Name: <input type="text" asp-for="SearchString"/>
Reason:
<select asp-for="TicketReason" asp-items="Model.Reason">
Expand Down
2 changes: 1 addition & 1 deletion CWASP Razor Edition/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - CWASP_Razor_Edition</title>
<title>@ViewData["Title"] - CWASP</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<!-- <link rel="stylesheet" href="~/CWASP_Razor_Edition.styles.css" asp-append-version="true" /> -->
Expand Down
2 changes: 1 addition & 1 deletion CWASP Razor Edition/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddDbContext<CWASP_Razor_EditionContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("CWASP_Razor_EditionContext") ?? throw new InvalidOperationException("Connection string 'CWASP_Razor_EditionContext' not found.")));
options.UseSqlServer(builder.Configuration.GetConnectionString("CWASPdbconnection") ?? throw new InvalidOperationException("Connection string 'CWASPdbconnection' not found.")));
builder.Services.AddApplicationInsightsTelemetry(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"]);

Check warning on line 11 in CWASP Razor Edition/Program.cs

View workflow job for this annotation

GitHub Actions / build

'ApplicationInsightsExtensions.AddApplicationInsightsTelemetry(IServiceCollection, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsightsTelemetry() overload which accepts Action<ApplicationInsightsServiceOptions> and set ApplicationInsightsServiceOptions.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'

Check warning on line 11 in CWASP Razor Edition/Program.cs

View workflow job for this annotation

GitHub Actions / build

'ApplicationInsightsExtensions.AddApplicationInsightsTelemetry(IServiceCollection, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsightsTelemetry() overload which accepts Action<ApplicationInsightsServiceOptions> and set ApplicationInsightsServiceOptions.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'

var app = builder.Build();
Expand Down
14 changes: 14 additions & 0 deletions CWASP Razor Edition/libman.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "1.0",
"defaultProvider": "unpkg",
"libraries": [
{
"library": "@microsoft/signalr@latest",
"destination": "wwwroot/js/signalr/",
"files": [
"dist/browser/signalr.js",
"dist/browser/signalr.min.js"
]
}
]
}
Loading

0 comments on commit 4f30fed

Please sign in to comment.