diff --git a/src/Yavsc/Extensions/HostingExtensions.cs b/src/Yavsc/Extensions/HostingExtensions.cs index b0f3f63f..aa0ccd43 100644 --- a/src/Yavsc/Extensions/HostingExtensions.cs +++ b/src/Yavsc/Extensions/HostingExtensions.cs @@ -47,6 +47,8 @@ public static class HostingExtensions public static WebApplication ConfigureWebAppServices(this WebApplicationBuilder builder) { + builder.Services.AddSwaggerGen(); + IServiceCollection services = LoadConfiguration(builder); services.AddSession(); @@ -55,7 +57,6 @@ public static class HostingExtensions // Add the system clock service - _ = services.AddSingleton(); _ = services.AddSingleton(); _ = services.AddSingleton(); _ = services.AddTransient(); @@ -344,8 +345,7 @@ public static class HostingExtensions JwtSecurityTokenHandler.DefaultMapInboundClaims = true; if (app.Environment.IsDevelopment()) { - // to fix Home/Error app.UseDeveloperExceptionPage(); - app.UseExceptionHandler("/Home/Error"); + app.UseDeveloperExceptionPage(); } else { @@ -368,6 +368,9 @@ public static class HostingExtensions } else await next(); }); + + app.UseSwagger(); + app.UseSwaggerUI(); app.UseStaticFiles(); app.UseRouting(); app.UseIdentityServer(); @@ -393,7 +396,7 @@ public static class HostingExtensions } private static void InitializeDatabase(this IApplicationBuilder app) { - using (var serviceScope = app.ApplicationServices.GetService().CreateScope()) + using (var serviceScope = app.ApplicationServices.GetRequiredService().CreateScope()) { serviceScope.ServiceProvider.GetRequiredService().Database.Migrate(); diff --git a/src/Yavsc/wwwroot/css/site.css b/src/Yavsc/wwwroot/css/site.css index a8260ce8..58ec8a12 100644 --- a/src/Yavsc/wwwroot/css/site.css +++ b/src/Yavsc/wwwroot/css/site.css @@ -29,10 +29,6 @@ input[type='checkbox'] { min-width: 1em; min-height: 1em; } -.container { - padding: .5em; - margin: .5em; } - .post { background-color: #290505; color: #c4fbff; @@ -95,7 +91,7 @@ input[type='checkbox'] { .container { background-color: #000000; color: #e0e0e0; - padding: 0; + padding: .5em; margin: 0; } .post { @@ -140,3 +136,6 @@ body { .display-field { display: inline; } + +.navbar-brand { + padding: .5em; } diff --git a/src/Yavsc/wwwroot/css/site.min.css b/src/Yavsc/wwwroot/css/site.min.css index 36276184..06dde42e 100644 --- a/src/Yavsc/wwwroot/css/site.min.css +++ b/src/Yavsc/wwwroot/css/site.min.css @@ -1,11 +1,11 @@ .grants-page.card{margin-top:20px;border-bottom:1px solid#fd8134;}.grants-page.card.card-title{font-size:120%;font-weight:bold;}.grants-page.card.card-title img{width:100px;height:100px;}.grants-page.card label{font-weight:bold;}.navbar-dark.navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");} div.carousel-inner>div.item>div.carousel-caption-s{margin:.5em;background-color:#11415faa;color:#ffffc8;font-weight:bold;padding:.5em;} img.blogphoto{max-width:100%;max-height:100%;} -input[type='checkbox']{appearance:auto;min-width:1em;min-height:1em;}.container{padding:.5em;margin:.5em;}.post{background-color:#290505;color:#c4fbff;padding:.7em;border-radius:2em;border:solid#b29e9e 2pt;}.actiongroup{float:right;margin:.5em;}.float-left{float:left;margin:.5em;} +input[type='checkbox']{appearance:auto;min-width:1em;min-height:1em;}.post{background-color:#290505;color:#c4fbff;padding:.7em;border-radius:2em;border:solid#b29e9e 2pt;}.actiongroup{float:right;margin:.5em;}.float-left{float:left;margin:.5em;} a{color:var(--blue);} a.close{cursor:pointer;} address{padding:.2em;margin:.2em;}.grants-page.card{margin-top:20px;border-bottom:1px solid lightgray;}.grants-page.card.card-title{font-size:120%;font-weight:bold;}.grants-page.card.card-title img{width:100px;height:100px;}.grants-page.card label{font-weight:bold;}.navbar-dark.navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");} div.carousel-inner>div.item>div.carousel-caption-s{margin:.5em;background-color:#11415faa;color:#ffffc8;font-weight:bold;padding:.5em;} img.blogphoto{max-width:100%;max-height:100%;} -input[type='checkbox']{appearance:auto;min-width:1em;min-height:1em;}.container{background-color:#000000;color:#e0e0e0;padding:0;margin:0;}.post{background-color:#290505;color:#c4fbff;padding:.3em;margin:.3em;border-radius:2em;border:solid#b29e9e 2pt;}.post.photo{max-height:100%;max-width:100%;}.actiongroup{float:right;margin:.5em;}.float-left{float:left;margin:.5em;} -body{font:1rem/1.5 var(--font-family-sans-serif);color:#e0e0e0;background-color:#000000;}.card{max-height:20em;max-width:30em;display:inline-table;}.card.card-photo{border:solid 1px#ffffffd4;max-height:15em;max-width:30em;}.card.index-post-title{display:inline;}.display-label{display:inline;font-style:italic;font-weight:300;}.display-field{display:inline;} \ No newline at end of file +input[type='checkbox']{appearance:auto;min-width:1em;min-height:1em;}.container{background-color:#000000;color:#e0e0e0;padding:.5em;margin:0;}.post{background-color:#290505;color:#c4fbff;padding:.3em;margin:.3em;border-radius:2em;border:solid#b29e9e 2pt;}.post.photo{max-height:100%;max-width:100%;}.actiongroup{float:right;margin:.5em;}.float-left{float:left;margin:.5em;} +body{font:1rem/1.5 var(--font-family-sans-serif);color:#e0e0e0;background-color:#000000;}.card{max-height:20em;max-width:30em;display:inline-table;}.card.card-photo{border:solid 1px#ffffffd4;max-height:15em;max-width:30em;}.card.index-post-title{display:inline;}.display-label{display:inline;font-style:italic;font-weight:300;}.display-field{display:inline;}.navbar-brand{padding:.5em;} \ No newline at end of file diff --git a/src/Yavsc/wwwroot/css/site.scss b/src/Yavsc/wwwroot/css/site.scss index be91e946..74beb3e8 100644 --- a/src/Yavsc/wwwroot/css/site.scss +++ b/src/Yavsc/wwwroot/css/site.scss @@ -54,11 +54,6 @@ input[type='checkbox'] { min-height: 1em; } -.container { - padding: .5em; - margin: .5em; -} - .post { background-color: $post-background-color; color: $post-color; @@ -138,7 +133,7 @@ input[type='checkbox'] { .container { background-color: $background-color; color: $color; - padding: 0; + padding: .5em; margin: 0; } @@ -198,3 +193,8 @@ body { .display-field { display: inline; } + +.navbar-brand +{ + padding: .5em; +} diff --git a/src/sampleWebAsWebApiClient/Model/Error.cs b/src/sampleWebAsWebApiClient/Model/Error.cs index c1fe990b..9a42c203 100644 --- a/src/sampleWebAsWebApiClient/Model/Error.cs +++ b/src/sampleWebAsWebApiClient/Model/Error.cs @@ -1,9 +1,8 @@ using System; - public class ErrorViewModel - { - public string RequestId { get; set; } - - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - } +public class ErrorViewModel +{ + public string RequestId { get; set; } = String.Empty; + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); +}