diff --git a/Directory.Packages.props b/Directory.Packages.props index 00b5162..2b310a7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,25 +6,25 @@ - - - - - - - - - + + + + + + + + + - - + + - - - - - - + + + + + + \ No newline at end of file diff --git a/src/RDMG.Core/ConfigureServices.cs b/src/RDMG.Core/ConfigureServices.cs index ba5052a..22bb9ed 100644 --- a/src/RDMG.Core/ConfigureServices.cs +++ b/src/RDMG.Core/ConfigureServices.cs @@ -3,7 +3,7 @@ using RDMG.Core.Abstractions.Services; using RDMG.Core.Generator; using RDMG.Core.Services; -using System; +using RDMG.Core.Services.Automapper; namespace RDMG.Core; @@ -22,8 +22,7 @@ this IServiceCollection services .AddScoped() .AddScoped(); - services.AddAutoMapper(cfg => { cfg.AllowNullCollections = true; } - , AppDomain.CurrentDomain.GetAssemblies()); + services.AddAutoMapper(cfg => { cfg.AllowNullCollections = true; }, typeof(DungeonProfile)); return services; } diff --git a/src/RDMG.Infrastructure/ConfigureServices.cs b/src/RDMG.Infrastructure/ConfigureServices.cs index d5825bf..b701770 100644 --- a/src/RDMG.Infrastructure/ConfigureServices.cs +++ b/src/RDMG.Infrastructure/ConfigureServices.cs @@ -12,8 +12,10 @@ using System; using System.IO; using System.Reflection; +using RDMG.Infrastructure.Repository.Automapper; namespace RDMG.Infrastructure; + public static class ConfigureServices { public static IServiceCollection AddInfrastructureServices( @@ -26,10 +28,11 @@ public static IServiceCollection AddInfrastructureServices( services.AddDbContext((sp, options) => { options.UseSqlServer(configuration.GetConnectionString(AppDbContext.Rdmg), - sqlServerOptionsAction: sqlOptions => - { - sqlOptions.MigrationsAssembly(typeof(SqlServerContext).GetTypeInfo().Assembly.GetName().Name); - }) + sqlServerOptionsAction: sqlOptions => + { + sqlOptions.MigrationsAssembly(typeof(SqlServerContext).GetTypeInfo().Assembly.GetName() + .Name); + }) .AddInterceptors( ActivatorUtilities.CreateInstance(sp)); }); @@ -44,10 +47,11 @@ public static IServiceCollection AddInfrastructureServices( services.AddDbContext((sp, options) => { options.UseSqlite(connString?.Replace(SqliteContext.HomeToken, home), - sqliteOptionsAction: sqlOptions => - { - sqlOptions.MigrationsAssembly(typeof(SqliteContext).GetTypeInfo().Assembly.GetName().Name); - }) + sqliteOptionsAction: sqlOptions => + { + sqlOptions.MigrationsAssembly(typeof(SqliteContext).GetTypeInfo().Assembly.GetName() + .Name); + }) .AddInterceptors( ActivatorUtilities.CreateInstance(sp)); }); @@ -58,7 +62,8 @@ public static IServiceCollection AddInfrastructureServices( break; default: throw new ServiceException( - string.Format(Resources.Error.DbProviderError, configuration.GetConnectionString(AppDbContext.DbProvider))); + string.Format(Resources.Error.DbProviderError, + configuration.GetConnectionString(AppDbContext.DbProvider))); } Configure(services, configuration); @@ -74,6 +79,7 @@ private static void Configure(IServiceCollection services, IConfiguration config .AddScoped() .AddScoped() .AddScoped(); + services.AddAutoMapper(cfg => { cfg.AllowNullCollections = true; }, typeof(DungeonProfile)); } public static IServiceCollection AddTestInfrastructureServices(this IServiceCollection services, @@ -83,10 +89,10 @@ public static IServiceCollection AddTestInfrastructureServices(this IServiceColl services.AddDbContext((sp, options) => { options.UseSqlite(connection, - sqliteOptionsAction: sqlOptions => - { - sqlOptions.MigrationsAssembly(typeof(SqliteContext).GetTypeInfo().Assembly.GetName().Name); - }) + sqliteOptionsAction: sqlOptions => + { + sqlOptions.MigrationsAssembly(typeof(SqliteContext).GetTypeInfo().Assembly.GetName().Name); + }) .AddInterceptors(ActivatorUtilities.CreateInstance(sp)); }); services.AddScoped(sp => diff --git a/src/RDMG.Web/ConfigureServices.cs b/src/RDMG.Web/ConfigureServices.cs index db68268..b5455b7 100644 --- a/src/RDMG.Web/ConfigureServices.cs +++ b/src/RDMG.Web/ConfigureServices.cs @@ -2,6 +2,7 @@ using RDMG.Core.Abstractions.Services; using RDMG.Core.Abstractions.Services.Exceptions; using RDMG.Infrastructure.Data; +using RDMG.Web.Automapper; using RDMG.Web.Services; using Serilog; @@ -16,7 +17,7 @@ public static IServiceCollection AddWebServices(this IServiceCollection services services.Configure(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. - options.CheckConsentNeeded = _ => true; + options.CheckConsentNeeded = _ => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) @@ -25,7 +26,7 @@ public static IServiceCollection AddWebServices(this IServiceCollection services options.LoginPath = new PathString("/Auth/Login"); options.AccessDeniedPath = new PathString("/Auth/Forbidden/"); }); - + services.AddAutoMapper(cfg => { cfg.AllowNullCollections = true; }, typeof(AuthProfile)); services.AddMemoryCache(); services.AddMvc() @@ -56,7 +57,7 @@ public static IHostBuilder AddSerilog(this IHostBuilder host, default: throw new ServiceException( string.Format(Resources.Error.DbProviderError, - configuration.GetConnectionString(AppDbContext.DbProvider))); + configuration.GetConnectionString(AppDbContext.DbProvider))); } return host; diff --git a/src/RDMG.Web/RDMG.Web.csproj b/src/RDMG.Web/RDMG.Web.csproj index aaf7ef1..ba2b9a8 100644 --- a/src/RDMG.Web/RDMG.Web.csproj +++ b/src/RDMG.Web/RDMG.Web.csproj @@ -5,7 +5,7 @@ enable true true - 1.0.2.0 + 1.0.3.0 b2a492d1-90ea-4e42-b3e5-5d962495bef1 diff --git a/src/RDMG.Web/Views/Home/Privacy.cshtml b/src/RDMG.Web/Views/Home/Privacy.cshtml deleted file mode 100644 index bba9b06..0000000 --- a/src/RDMG.Web/Views/Home/Privacy.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Privacy Policy"; -} -

@ViewData["Title"]

- -

Use this page to detail your site's privacy policy.

diff --git a/src/RDMG.Web/Views/Shared/_CookieConsentPartial.cshtml b/src/RDMG.Web/Views/Shared/_CookieConsentPartial.cshtml deleted file mode 100644 index fd744b8..0000000 --- a/src/RDMG.Web/Views/Shared/_CookieConsentPartial.cshtml +++ /dev/null @@ -1,27 +0,0 @@ -@using Microsoft.AspNetCore.Http.Features - -@{ - var consentFeature = Context.Features.Get(); - var showBanner = !consentFeature?.CanTrack ?? false; - var cookieString = consentFeature?.CreateConsentCookie(); -} - -@if (showBanner) -{ - - -} \ No newline at end of file diff --git a/src/RDMG.Web/Views/Shared/_Layout.cshtml b/src/RDMG.Web/Views/Shared/_Layout.cshtml index fc44111..f6f98d9 100644 --- a/src/RDMG.Web/Views/Shared/_Layout.cshtml +++ b/src/RDMG.Web/Views/Shared/_Layout.cshtml @@ -1,54 +1,57 @@  - - + + @ViewData["Title"] - RDMG - + -
- -
+ + + +
+
+ @RenderBody() +
+
+ +
- -
- @RenderBody() -
+ © @DateTime.Now.Year @Resources.Common.Copyright - @System.Reflection.Assembly.GetEntryAssembly()?.GetName().Version?.ToString()
+
-
-
- © @DateTime.Now.Year @Resources.Common.Copyright - @System.Reflection.Assembly.GetEntryAssembly()?.GetName().Version?.ToString() - @Resources.Common.Privacy -
-
- - + - - @RenderSection("Scripts", required: false) + +@await RenderSectionAsync("Scripts", required: false) diff --git a/src/RDMG.Web/Views/Shared/_Login.cshtml b/src/RDMG.Web/Views/Shared/_Login.cshtml index f83edba..613613f 100644 --- a/src/RDMG.Web/Views/Shared/_Login.cshtml +++ b/src/RDMG.Web/Views/Shared/_Login.cshtml @@ -1,11 +1,12 @@ @using RDMG.Web.Helpers -@if (User?.Identity?.IsAuthenticated == true) +@if (User.Identity?.IsAuthenticated == true) {