diff --git a/.github/workflows/todo-sample.cd.yml b/.github/workflows/todo-sample.cd.yml index ad5682e49c..9a12fedc2e 100644 --- a/.github/workflows/todo-sample.cd.yml +++ b/.github/workflows/todo-sample.cd.yml @@ -149,6 +149,16 @@ jobs: - name: Set app center secret run: (Get-Content TodoSample\src\Client\TodoSample.Client.Windows\Program.cs) -Replace 'appCenterSecret = null;', 'appCenterSecret = "39f576f2-7c16-4990-af3f-7b70509d41e2";' | Out-File -Encoding utf8 TodoSample\src\Client\TodoSample.Client.Windows\Program.cs shell: pwsh + + - name: Delete App Splash Screen + run: rm TodoSample/src/Client/TodoSample.Client.Windows/Resources/SplashScreen.png + + - name: Extract App Splash Screen from env + uses: timheuer/base64-to-file@v1.2 + with: + fileDir: './TodoSample/src/Client/TodoSample.Client.Windows/Resources/' + fileName: 'SplashScreen.png' + encodedString: ${{ vars.TODO_WPF_SPLASH_SCREEN }} - name: Generate CSS/JS files run: dotnet build TodoSample\src\Client\TodoSample.Client.Core\TodoSample.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" --no-restore -c Release diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/app.ts b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/app.ts index 2a14291a63..f009a5f682 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/app.ts +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/app.ts @@ -17,11 +17,11 @@ BitTheme.init({ if (newTheme === 'dark') { document.body.classList.add('theme-dark'); document.body.classList.remove('theme-light'); - document.querySelector("meta[name=theme-color]")!.setAttribute('content', '#0d1117'); } else { document.body.classList.add('theme-light'); document.body.classList.remove('theme-dark'); - document.querySelector("meta[name=theme-color]")!.setAttribute('content', '#ffffff'); } + const primaryBgColor = getComputedStyle(document.documentElement).getPropertyValue('--bit-clr-bg-pri'); + document.querySelector("meta[name=theme-color]")!.setAttribute('content', primaryBgColor); } }); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/ThemeColors.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/ThemeColors.cs new file mode 100644 index 0000000000..982f092730 --- /dev/null +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/ThemeColors.cs @@ -0,0 +1,8 @@ +namespace Boilerplate.Client.Core.Styles; + +public class ThemeColors +{ + public static readonly string PrimaryDarkBgColor = "#000000"; + public static readonly string PrimaryLightBgColor = "#FFFFFF"; + // In case you need to change the background color, make sure to also update app.scss's --bit-clr-bg-pri accordingly. +} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/app.scss b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/app.scss index 097e2078cd..eb84cab246 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/app.scss +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/app.scss @@ -2,6 +2,11 @@ --bit-status-bar-height: 0px; } +:root[bit-theme="dark"] { + --bit-clr-bg-pri: #000000; + // In case you need to change the background color, make sure to also update ThemeColors.cs's PrimaryDarkBgColor accordingly. +} + * { box-sizing: border-box; font-family: "Segoe UI"; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MainPage.xaml b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MainPage.xaml index 8c7e4e5b48..6947f39d3a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MainPage.xaml +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MainPage.xaml @@ -4,17 +4,13 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:b="clr-namespace:Microsoft.AspNetCore.Components.WebView.Maui;assembly=Microsoft.AspNetCore.Components.WebView.Maui" xmlns:core="clr-namespace:Boilerplate.Client.Core;assembly=Boilerplate.Client.Core" - BackgroundColor="{AppThemeBinding Light={OnPlatform Android=#0D2960, - Default=#ffffff}, - Dark={OnPlatform Android=#0D2960, - Default=#000000}}"> - + xmlns:themeColors="clr-namespace:Boilerplate.Client.Core.Styles;assembly=Boilerplate.Client.Core" + BackgroundColor="{AppThemeBinding Light={x:Static themeColors:ThemeColors.PrimaryLightBgColor}, + Dark={x:Static themeColors:ThemeColors.PrimaryDarkBgColor}}"> diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MauiProgram.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MauiProgram.cs index 9c839490e9..4ae4dd3a96 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MauiProgram.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MauiProgram.cs @@ -3,7 +3,9 @@ using Maui.InAppReviews; using Maui.Android.InAppUpdates; using Microsoft.Maui.LifecycleEvents; -using Boilerplate.Client.Core; +using Boilerplate.Client.Core.Styles; +using Boilerplate.Client.Maui.Services; +using Microsoft.Maui.Platform; #if iOS || Mac using UIKit; using WebKit; @@ -55,7 +57,7 @@ bool HandleAppLink(NSUserActivity? userActivity) { var url = $"{userActivity.WebPageUrl.Path}?{userActivity.WebPageUrl.Query}"; - _ = Routes.OpenUniversalLink(url); + _ = Core.Routes.OpenUniversalLink(url); return true; } @@ -94,11 +96,10 @@ private static void SetupBlazorWebView() BlazorWebViewHandler.BlazorWebViewMapper.AppendToMapping("CustomBlazorWebViewMapper", static (handler, view) => { var webView = handler.PlatformView; + var webViewBackgroundColor = AppInfo.Current.RequestedTheme == AppTheme.Dark ? + ThemeColors.PrimaryDarkBgColor : ThemeColors.PrimaryLightBgColor; #if Windows - if (AppInfo.Current.RequestedTheme == AppTheme.Dark) - { - webView.DefaultBackgroundColor = Microsoft.UI.Colors.Black; - } + webView.DefaultBackgroundColor = Color.FromArgb(webViewBackgroundColor).ToWindowsColor(); if (AppEnvironment.IsDev() is false) { @@ -132,7 +133,7 @@ private static void SetupBlazorWebView() } } #elif Android - webView.SetBackgroundColor(Android.Graphics.Color.Transparent); + webView.SetBackgroundColor(Android.Graphics.Color.ParseColor(webViewBackgroundColor)); webView.OverScrollMode = Android.Views.OverScrollMode.Never; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/Resources/values/colors.xml b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/Resources/values/colors.xml index ac84613001..55344e5192 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/Resources/values/colors.xml +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/Resources/values/colors.xml @@ -1,6 +1,3 @@ - #0D2960 - #0D2960 - #0D2960 \ No newline at end of file diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiDeviceCoordinator.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiDeviceCoordinator.cs index 4c851d9c4c..76d97f865f 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiDeviceCoordinator.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiDeviceCoordinator.cs @@ -1,4 +1,6 @@ //-:cnd:noEmit +using Boilerplate.Client.Core.Styles; + namespace Boilerplate.Client.Maui.Services; /// @@ -36,7 +38,7 @@ public async Task ApplyTheme(bool isDark) window!.DecorView!.SystemUiFlags &= ~Android.Views.SystemUiFlags.LightStatusBar; } - window.SetStatusBarColor(isDark ? Android.Graphics.Color.ParseColor("#0D1117") : Android.Graphics.Color.White); + window.SetStatusBarColor(Android.Graphics.Color.ParseColor(isDark ? ThemeColors.PrimaryDarkBgColor : ThemeColors.PrimaryLightBgColor)); #elif IOS var statusBarStyle = isDark ? UIKit.UIStatusBarStyle.LightContent : UIKit.UIStatusBarStyle.DarkContent; await Device.InvokeOnMainThreadAsync(() => diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/wwwroot/index.html b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/wwwroot/index.html index 22f0c3096b..adae667121 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/wwwroot/index.html +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/wwwroot/index.html @@ -34,9 +34,6 @@ - -
+ +
diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/index.html b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/index.html index 4549235e63..99e7826a74 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/index.html +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/index.html @@ -24,7 +24,7 @@ - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/manifest.json b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/manifest.json index 6da1123134..43292d97a5 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/manifest.json +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/manifest.json @@ -9,7 +9,7 @@ "theme_color": "#2EA3FF", "related_applications": [], "name": "bit Boilerplate", - "background_color": "#0D1117", + "background_color": "#0D2960", "short_name": "bit Boilerplate", "prefer_related_applications": false, "display_override": [ "window-controls-overlay" ], diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml index 270ab536cb..0718cfd462 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml @@ -5,4 +5,10 @@ DispatcherUnhandledException="App_DispatcherUnhandledException" Exit="App_Exit" Startup="App_Startup" - StartupUri="MainWindow.xaml" /> + StartupUri="MainWindow.xaml"> + + + #0D2960 + + + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs index 312b689940..184f10ccd6 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs @@ -3,11 +3,31 @@ using System.Windows; using System.Text.Json; using System.Collections; +using Microsoft.Win32; +using System.Windows.Media; +using Boilerplate.Client.Core.Styles; namespace Boilerplate.Client.Windows; public partial class App { + public App() + { + InitializeComponent(); + + var splash = new SplashScreen(typeof(App).Assembly, @"Resources\SplashScreen.png"); + splash.Show(autoClose: true, topMost: true); + + Resources["PrimaryBgColor"] = new BrushConverter().ConvertFrom(IsDarkTheme() ? ThemeColors.PrimaryDarkBgColor : ThemeColors.PrimaryLightBgColor); + } + + private static bool IsDarkTheme() + { + using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"); + var value = key?.GetValue("AppsUseLightTheme"); + return value is int i && i == 0; + } + const string WindowsStorageFilename = "windows.storage.json"; private void App_Startup(object sender, StartupEventArgs e) @@ -38,7 +58,7 @@ private void App_DispatcherUnhandledException(object sender, System.Windows.Thre { try { - ((MainWindow)MainWindow).BlazorWebView.Services.GetRequiredService().Handle(e.Exception); + ((MainWindow)MainWindow).AppWebView.Services.GetRequiredService().Handle(e.Exception); } catch { } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj index c969b30b77..215981ef1d 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj @@ -56,6 +56,10 @@ + + + + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml index a717749574..e8438e3504 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml @@ -7,11 +7,12 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Title="Boilerplate" + Background="{DynamicResource PrimaryBgColor}" WindowState="Maximized" mc:Ignorable="d"> diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml.cs index a1f9631a3b..7a336a070b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml.cs @@ -10,28 +10,29 @@ public MainWindow() var services = new ServiceCollection(); services.ConfigureServices(); InitializeComponent(); - BlazorWebView.Services = services.BuildServiceProvider(); + AppWebView.Services = services.BuildServiceProvider(); if (CultureInfoManager.MultilingualEnabled) { - BlazorWebView.Services.GetRequiredService().SetCurrentCulture(App.Current.Properties["Culture"]?.ToString() ?? CultureInfo.CurrentUICulture.Name); + AppWebView.Services.GetRequiredService().SetCurrentCulture(App.Current.Properties["Culture"]?.ToString() ?? CultureInfo.CurrentUICulture.Name); } - BlazorWebView.Services.GetRequiredService().Subscribe(PubSubMessages.CULTURE_CHANGED, async culture => + AppWebView.Services.GetRequiredService().Subscribe(PubSubMessages.CULTURE_CHANGED, async culture => { App.Current.Shutdown(); Application.Restart(); }); - BlazorWebView.Loaded += async delegate + AppWebView.Loaded += async delegate { - await BlazorWebView.WebView.EnsureCoreWebView2Async(); - var settings = BlazorWebView.WebView.CoreWebView2.Settings; + AppWebView.WebView.DefaultBackgroundColor = ColorTranslator.FromHtml(Background.ToString()); + await AppWebView.WebView.EnsureCoreWebView2Async(); + var settings = AppWebView.WebView.CoreWebView2.Settings; if (AppEnvironment.IsDev() is false) { settings.IsZoomControlEnabled = false; settings.AreBrowserAcceleratorKeysEnabled = false; } - BlazorWebView.WebView.NavigationCompleted += async delegate + AppWebView.WebView.NavigationCompleted += async delegate { - await BlazorWebView.WebView.ExecuteScriptAsync("Blazor.start()"); + await AppWebView.WebView.ExecuteScriptAsync("Blazor.start()"); }; }; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs index b1c1485830..93d598b664 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs @@ -22,12 +22,11 @@ public static void Main(string[] args) // https://github.com/velopack/velopack VelopackApp.Build().Run(); var application = new App(); - application.InitializeComponent(); Task.Run(async () => { try { - var services = await App.Current.Dispatcher.InvokeAsync(() => ((MainWindow)App.Current.MainWindow).BlazorWebView.Services); + var services = await App.Current.Dispatcher.InvokeAsync(() => ((MainWindow)App.Current.MainWindow).AppWebView.Services); var windowsUpdateSettings = services.GetRequiredService>().Value; if (windowsUpdateSettings?.FilesUrl is null) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Resources/SplashScreen.png b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Resources/SplashScreen.png new file mode 100644 index 0000000000..3caa371185 Binary files /dev/null and b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Resources/SplashScreen.png differ diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Components/EmailTokenTemplate.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Components/EmailTokenTemplate.razor index 8d6cfa66c2..e70c6d0dc6 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Components/EmailTokenTemplate.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Components/EmailTokenTemplate.razor @@ -11,7 +11,7 @@ - @EmailLocalizer[nameof(EmailStrings.ConfirmationEmailSubject), Model.Token] + @EmailLocalizer[nameof(EmailStrings.ConfirmationEmailSubject), Model.Token!]
diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Components/SocialSignedInPage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Components/SocialSignedInPage.razor index c9e8a0366f..2259a756fd 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Components/SocialSignedInPage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Components/SocialSignedInPage.razor @@ -29,8 +29,8 @@ @@media (prefers-color-scheme: dark) { body { - color: #e8e8e8; - background: #161b22; + color: #E8E8E8; + background: #161B22; } } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Identity/UserConfiguration.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Identity/UserConfiguration.cs index 3c0ed5298d..25c050988b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Identity/UserConfiguration.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Identity/UserConfiguration.cs @@ -17,13 +17,13 @@ public void Configure(EntityTypeBuilder builder) EmailConfirmed = true, LockoutEnabled = true, Gender = Gender.Other, - BirthDate = new DateTime(2023, 1, 1), + BirthDate = new DateTimeOffset(new DateOnly(2023, 1, 1), default, default), FullName = "Boilerplate test account", UserName = userName, NormalizedUserName = userName.ToUpperInvariant(), Email = email, NormalizedEmail = email.ToUpperInvariant(), - EmailTokenRequestedOn = new DateTime(2023,1,1), + EmailTokenRequestedOn = new DateTimeOffset(new DateOnly(2023, 1, 1), default, default), PhoneNumber = "+31684207362", PhoneNumberConfirmed = true, SecurityStamp = "959ff4a9-4b07-4cc1-8141-c5fc033daf83", diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Product/ProductConfiguration.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Product/ProductConfiguration.cs index 15c0f460b1..c81c801f04 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Product/ProductConfiguration.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Product/ProductConfiguration.cs @@ -6,7 +6,7 @@ public class ProductConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { - DateTime baseDate = DateTime.Parse("2022-07-12"); + DateTimeOffset baseDate = DateTimeOffset.Parse("2022-07-12", styles: DateTimeStyles.AssumeUniversal); builder.HasData( new() { Id = Guid.Parse("9a59dda2-7b12-4cc1-9658-d2586eef91d4"), Name = "Mustang", Price = 27155, Description = "The Ford Mustang is ranked #1 in Sports Cars", CreatedOn = baseDate.AddDays(-10), CategoryId = Guid.Parse("31d78bd0-0b4f-4e87-b02f-8f66d4ab2845") }, diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppSecureJwtDataFormat.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppSecureJwtDataFormat.cs index 9a703b50e5..ff87b23e2e 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppSecureJwtDataFormat.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppSecureJwtDataFormat.cs @@ -57,7 +57,7 @@ public string Protect(AuthenticationTicket data, string? purpose) { Issuer = appSettings.Identity.Issuer, Audience = appSettings.Identity.Audience, - IssuedAt = DateTime.UtcNow, + IssuedAt = DateTimeOffset.UtcNow.DateTime, Expires = data.Properties.ExpiresUtc!.Value.UtcDateTime, SigningCredentials = new SigningCredentials(validationParameters.IssuerSigningKey, SecurityAlgorithms.RsaSha512), Subject = new ClaimsIdentity(data.Principal.Claims), diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Enums/EmailTemplate.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Enums/EmailTemplate.cs deleted file mode 100644 index 5de06da3b0..0000000000 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Enums/EmailTemplate.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Boilerplate.Shared.Enums; - -[JsonConverter(typeof(JsonStringEnumConverter))] -public enum EmailTemplate -{ - EmailChange, - EmailConfirmation -}