From 938f5b530174439318f35ee9a4677c9e138f0ca2 Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sat, 14 Sep 2024 20:22:44 +0200 Subject: [PATCH 1/7] Add missing partial to Boilerplate classes #8631 --- .../Data/OfflineDbContext.cs | 2 +- .../Extensions/IConfigurationBuilderExtensions.cs | 2 +- .../Extensions/IJSRuntimeExtensions.cs | 2 +- .../Extensions/IServiceCollectionExtensions.cs | 2 +- .../Extensions/NavigationManagerExtensions.cs | 2 +- .../Services/AppPlatform.cs | 2 +- .../Services/AppRenderMode.cs | 2 +- .../HttpMessageHandlers/AuthDelegatingHandler.cs | 2 +- .../ExceptionDelegatingHandler.cs | 2 +- .../RequestHeadersDelegationHandler.cs | 2 +- .../HttpMessageHandlers/RequestOptionNames.cs | 2 +- .../HttpMessageHandlers/RetryDelegatingHandler.cs | 2 +- .../Services/MessageBoxData.cs | 2 +- .../Services/NoopLocalHttpServer.cs | 2 +- .../Boilerplate.Client.Core/Services/ODataQuery.cs | 2 +- .../Services/PrerenderStateService.cs | 2 +- .../Services/PubSubMessages.cs | 2 +- .../Boilerplate.Client.Core/Styles/ThemeColors.cs | 2 +- .../Client/Boilerplate.Client.Maui/MauiProgram.cs | 2 +- .../Platforms/Android/MainActivity.cs | 2 +- .../Platforms/Android/MainApplication.cs | 2 +- .../Platforms/MacCatalyst/AppDelegate.cs | 2 +- .../Platforms/MacCatalyst/Program.cs | 2 +- .../Platforms/Tizen/Main.cs | 2 +- .../Platforms/iOS/AppDelegate.cs | 2 +- .../Platforms/iOS/Program.cs | 2 +- .../Services/MauiDeviceCoordinator.cs | 2 +- .../Services/MauiExternalNavigationService.cs | 2 +- .../Services/MauiStorageService.cs | 2 +- .../Services/WebDeviceCoordinator.cs | 2 +- .../Configuration/WindowsUpdateSettings.cs | 2 +- .../Services/WindowsDeviceCoordinator.cs | 2 +- .../Services/WindowsStorageService.cs | 2 +- .../Services/WindowsTelemetryInitializer.cs | 2 +- .../Server/Boilerplate.Server.Api/AppSettings.cs | 8 ++++---- .../Boilerplate.Server.Api/Data/AppDbContext.cs | 2 +- .../Category/CategoryConfiguration.cs | 2 +- .../Configurations/Identity/RoleConfiguration.cs | 2 +- .../Configurations/Identity/UserConfiguration.cs | 2 +- .../PostgresDateTimeOffsetConverter.cs | 4 ++-- .../Configurations/Product/ProductConfiguration.cs | 2 +- ...imaryKeySequentialGuidDefaultValueConvention.cs | 2 +- .../Extensions/HttpRequestExtensions.cs | 2 +- .../Extensions/SignInManagerExtensions.cs | 2 +- .../Extensions/UserManagerExtensions.cs | 2 +- .../Boilerplate.Server.Api/Hubs/IdentityHub.cs | 2 +- .../Models/Categories/Category.cs | 2 +- .../Models/Emailing/EmailTokenTemplateModel.cs | 2 +- .../Models/Emailing/OtpTemplateModel.cs | 2 +- .../Emailing/ResetPasswordTokenTemplateModel.cs | 2 +- .../Models/Emailing/TwoFactorTokenTemplateModel.cs | 2 +- .../Boilerplate.Server.Api/Models/Identity/Role.cs | 2 +- .../Boilerplate.Server.Api/Models/Identity/User.cs | 2 +- .../Models/Identity/UserSession.cs | 2 +- .../Models/Products/Product.cs | 2 +- .../Boilerplate.Server.Api/Models/Todo/TodoItem.cs | 2 +- .../Services/AppSecureJwtDataFormat.cs | 2 +- .../Services/AppUserClaimsPrincipalFactory.cs | 2 +- .../Services/AppUserConfirmation.cs | 2 +- .../GoogleRecaptchaVerificationResponse.cs | 2 +- .../Services/ODataOperationFilter.cs | 2 +- .../Extensions/HttpRequestExtensions.cs | 2 +- .../src/Shared/Attributes/AutoInjectAttribute.cs | 2 +- .../Shared/Attributes/DtoResourceTypeAttribute.cs | 2 +- .../src/Shared/Controllers/Attributes.cs | 14 +++++++------- .../src/Shared/Dtos/Categories/CategoryDto.cs | 2 +- .../OverallAnalyticsStatsDataResponseDto.cs | 2 +- .../ProductPercentagePerCategoryResponseDto.cs | 2 +- .../Dtos/Dashboard/ProductSaleStatResponseDto.cs | 2 +- .../ProductsCountPerCategoryResponseDto.cs | 2 +- .../Dtos/Identity/ChangePasswordRequestDto.cs | 2 +- .../Dtos/Identity/ChangeUserNameRequestDto.cs | 2 +- .../Shared/Dtos/Identity/ConfirmEmailRequestDto.cs | 4 ++-- .../Shared/Dtos/Identity/ConfirmPhoneRequestDto.cs | 4 ++-- .../src/Shared/Dtos/Identity/EditUserDto.cs | 2 +- .../src/Shared/Dtos/Identity/IdentityRequestDto.cs | 2 +- .../src/Shared/Dtos/Identity/RefreshRequestDto.cs | 2 +- .../Dtos/Identity/ResetPasswordRequestDto.cs | 2 +- .../Dtos/Identity/SendEmailTokenRequestDto.cs | 2 +- .../Dtos/Identity/SendPhoneTokenRequestDto.cs | 2 +- .../Identity/SendResetPasswordTokenRequestDto.cs | 2 +- .../src/Shared/Dtos/Identity/SignInRequestDto.cs | 2 +- .../src/Shared/Dtos/Identity/SignInResponseDto.cs | 2 +- .../src/Shared/Dtos/Identity/SignUpRequestDto.cs | 2 +- .../src/Shared/Dtos/Identity/TokenResponseDto.cs | 2 +- .../Dtos/Identity/TwoFactorAuthRequestDto.cs | 2 +- .../Dtos/Identity/TwoFactorAuthResponseDto.cs | 2 +- .../src/Shared/Dtos/Identity/UserDto.cs | 2 +- .../src/Shared/Dtos/Identity/UserSessionDto.cs | 2 +- .../src/Shared/Dtos/PagedResultDto.cs | 2 +- .../src/Shared/Dtos/Products/ProductDto.cs | 2 +- .../src/Shared/Dtos/Todo/TodoItemDto.cs | 2 +- .../src/Shared/Exceptions/BadRequestException.cs | 2 +- .../src/Shared/Exceptions/ConflictException.cs | 2 +- .../src/Shared/Exceptions/DomainLogicException.cs | 2 +- .../src/Shared/Exceptions/ErrorResourcePayload.cs | 6 +++--- .../src/Shared/Exceptions/ForbiddenException.cs | 2 +- .../src/Shared/Exceptions/KnownException.cs | 2 +- .../Shared/Exceptions/ResourceNotFoundException.cs | 2 +- .../Exceptions/ResourceValidationException.cs | 2 +- .../src/Shared/Exceptions/RestErrorInfo.cs | 2 +- .../src/Shared/Exceptions/RestException.cs | 2 +- .../Shared/Exceptions/ServerConnectionException.cs | 2 +- .../Shared/Exceptions/TooManyRequestsExceptions.cs | 2 +- .../src/Shared/Exceptions/UnauthorizedException.cs | 2 +- .../src/Shared/Exceptions/UnknownException.cs | 2 +- .../Shared/Extensions/ClaimsPrincipalExtensions.cs | 2 +- .../src/Shared/Extensions/ICollectionExtensions.cs | 2 +- .../Extensions/IConfigurationBuilderExtensions.cs | 2 +- .../Shared/Extensions/IConfigurationExtensions.cs | 2 +- .../Extensions/IServiceCollectionExtensions.cs | 2 +- .../Shared/Extensions/JsonSeralizerExtensions.cs | 2 +- .../src/Shared/Extensions/LinqExtensions.cs | 2 +- .../src/Shared/Extensions/TupleExtensions.cs | 6 +++--- .../Shared/Resources/StringLocalizerProvider.cs | 2 +- .../src/Shared/Services/AppEnvironment.cs | 2 +- .../src/Shared/Services/CultureInfoManager.cs | 2 +- .../src/Shared/Services/DateTimeProvider.cs | 2 +- .../Boilerplate/Bit.Boilerplate/src/Shared/Urls.cs | 2 +- .../Bit.Boilerplate/src/Tests/AppTestServer.cs | 2 +- .../Bit.Boilerplate/src/Tests/SampleApiTest.cs | 2 +- 121 files changed, 137 insertions(+), 137 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Data/OfflineDbContext.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Data/OfflineDbContext.cs index 5e874aa017..e19d864706 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Data/OfflineDbContext.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Data/OfflineDbContext.cs @@ -4,7 +4,7 @@ namespace Boilerplate.Client.Core.Data; -public class OfflineDbContext(DbContextOptions options) : DbContext(options) +public partial class OfflineDbContext(DbContextOptions options) : DbContext(options) { static OfflineDbContext() { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IConfigurationBuilderExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IConfigurationBuilderExtensions.cs index e71cbe49ae..c3c69249b7 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IConfigurationBuilderExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IConfigurationBuilderExtensions.cs @@ -3,7 +3,7 @@ namespace Microsoft.Extensions.Configuration; -public static class IConfigurationBuilderExtensions +public static partial class IConfigurationBuilderExtensions { /// /// Configuration priority (Lowest to highest) => diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IJSRuntimeExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IJSRuntimeExtensions.cs index 4771546f94..75d8b4e9b7 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IJSRuntimeExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IJSRuntimeExtensions.cs @@ -3,7 +3,7 @@ namespace Microsoft.JSInterop; -public static class IJSRuntimeExtensions +public static partial class IJSRuntimeExtensions { public static ValueTask GetBrowserPlatform(this IJSRuntime jsRuntime) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IServiceCollectionExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IServiceCollectionExtensions.cs index 8f14c59d73..3b85b88318 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IServiceCollectionExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/IServiceCollectionExtensions.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.DependencyInjection; -public static class IServiceCollectionExtensions +public static partial class IServiceCollectionExtensions { public static IServiceCollection AddClientCoreProjectServices(this IServiceCollection services) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/NavigationManagerExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/NavigationManagerExtensions.cs index 02f8ddf1b3..961e758049 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/NavigationManagerExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/NavigationManagerExtensions.cs @@ -2,7 +2,7 @@ namespace Microsoft.AspNetCore.Components; -public static class NavigationManagerExtensions +public static partial class NavigationManagerExtensions { public static string GetUriWithoutQueryParameter(this NavigationManager navigationManager, string key) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AppPlatform.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AppPlatform.cs index 0c529f0662..b626ff68f6 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AppPlatform.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AppPlatform.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Client.Core.Services; -public static class AppPlatform +public static partial class AppPlatform { public static bool IsBlazorHybrid { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AppRenderMode.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AppRenderMode.cs index d6a4a87b8e..21d9c2995a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AppRenderMode.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AppRenderMode.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Client.Core.Services; -public static class AppRenderMode +public static partial class AppRenderMode { public static readonly bool PrerenderEnabled = false; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/AuthDelegatingHandler.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/AuthDelegatingHandler.cs index 850fb0eb2d..c63deef0d8 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/AuthDelegatingHandler.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/AuthDelegatingHandler.cs @@ -4,7 +4,7 @@ namespace Boilerplate.Client.Core.Services.HttpMessageHandlers; -public class AuthDelegatingHandler(IAuthTokenProvider tokenProvider, IServiceProvider serviceProvider, IStorageService storageService, RetryDelegatingHandler handler) +public partial class AuthDelegatingHandler(IAuthTokenProvider tokenProvider, IServiceProvider serviceProvider, IStorageService storageService, RetryDelegatingHandler handler) : DelegatingHandler(handler) { protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/ExceptionDelegatingHandler.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/ExceptionDelegatingHandler.cs index ca01c6c564..c0f406f647 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/ExceptionDelegatingHandler.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/ExceptionDelegatingHandler.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Client.Core.Services.HttpMessageHandlers; -public class ExceptionDelegatingHandler(IStringLocalizer localizer, JsonSerializerOptions jsonSerializerOptions, HttpClientHandler httpClientHandler) +public partial class ExceptionDelegatingHandler(IStringLocalizer localizer, JsonSerializerOptions jsonSerializerOptions, HttpClientHandler httpClientHandler) : DelegatingHandler(httpClientHandler) { protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RequestHeadersDelegationHandler.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RequestHeadersDelegationHandler.cs index 7671dfd8aa..48cff22e48 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RequestHeadersDelegationHandler.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RequestHeadersDelegationHandler.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Client.Core.Services.HttpMessageHandlers; -public class RequestHeadersDelegationHandler(AuthDelegatingHandler handler) +public partial class RequestHeadersDelegationHandler(AuthDelegatingHandler handler) : DelegatingHandler(handler) { protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RequestOptionNames.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RequestOptionNames.cs index 53dcb7df49..3ead4cad05 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RequestOptionNames.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RequestOptionNames.cs @@ -4,7 +4,7 @@ /// The generated HTTP client proxy by Bit.SourceGenerators will automatically include these request options in the constructed HttpRequestMessage. /// You can access these values within HTTP message handlers, such as . /// -public class RequestOptionNames +public partial class RequestOptionNames { public const string IControllerType = nameof(IControllerType); public const string ActionName = nameof(ActionName); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RetryDelegatingHandler.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RetryDelegatingHandler.cs index 5191f6462f..1626265992 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RetryDelegatingHandler.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/RetryDelegatingHandler.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Client.Core.Services.HttpMessageHandlers; -public class RetryDelegatingHandler(ExceptionDelegatingHandler handler) +public partial class RetryDelegatingHandler(ExceptionDelegatingHandler handler) : DelegatingHandler(handler) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/MessageBoxData.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/MessageBoxData.cs index 8f3515e2af..fb1af21ec2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/MessageBoxData.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/MessageBoxData.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Client.Core.Services; -public class MessageBoxData(string message, string title, TaskCompletionSource taskCompletionSource) +public partial class MessageBoxData(string message, string title, TaskCompletionSource taskCompletionSource) { public string Message { get; set; } = message; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/NoopLocalHttpServer.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/NoopLocalHttpServer.cs index 84701aa88b..327e9a28ce 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/NoopLocalHttpServer.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/NoopLocalHttpServer.cs @@ -4,7 +4,7 @@ /// Currently only Windows clients have local http server to have better support for social login. /// In other platforms, we don't have local http server and we use a noop implementation. /// -public class NoopLocalHttpServer : ILocalHttpServer +public partial class NoopLocalHttpServer : ILocalHttpServer { public int Start(CancellationToken cancellationToken) => -1; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/ODataQuery.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/ODataQuery.cs index 9b05882d82..5c55536d16 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/ODataQuery.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/ODataQuery.cs @@ -5,7 +5,7 @@ namespace Boilerplate.Client.Core.Services; /// /// https://docs.microsoft.com/en-us/odata/concepts/queryoptions-overview /// -public class ODataQuery +public partial class ODataQuery { public int? Top { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/PrerenderStateService.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/PrerenderStateService.cs index 80168494ed..e17c7af9f2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/PrerenderStateService.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/PrerenderStateService.cs @@ -7,7 +7,7 @@ namespace Boilerplate.Client.Core.Services; /// /// For more information docs. /// -public class PrerenderStateService : IPrerenderStateService, IAsyncDisposable +public partial class PrerenderStateService : IPrerenderStateService, IAsyncDisposable { private PersistingComponentStateSubscription? subscription; private readonly PersistentComponentState? persistentComponentState; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/PubSubMessages.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/PubSubMessages.cs index 0a3ecee1c4..7104d05c18 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/PubSubMessages.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/PubSubMessages.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Client.Core.Services; -public static class PubSubMessages +public static partial class PubSubMessages { public const string USER_DATA_UPDATED = nameof(USER_DATA_UPDATED); public const string SHOW_MESSAGE = nameof(SHOW_MESSAGE); 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 index 982f092730..b072e2705b 100644 --- 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 @@ -1,6 +1,6 @@ namespace Boilerplate.Client.Core.Styles; -public class ThemeColors +public partial class ThemeColors { public static readonly string PrimaryDarkBgColor = "#000000"; public static readonly string PrimaryLightBgColor = "#FFFFFF"; 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 d1b041df5b..8d46e8600d 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 @@ -162,7 +162,7 @@ private static void SetupBlazorWebView() } #if iOS || Mac - public class CustomWKNavigationDelegate : WKNavigationDelegate + public partial class CustomWKNavigationDelegate : WKNavigationDelegate { public override void DecidePolicy(WKWebView webView, WKNavigationAction navigationAction, WKWebpagePreferences preferences, Action decisionHandler) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/MainActivity.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/MainActivity.cs index 8cfeacc1f8..84f16a20fe 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/MainActivity.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/MainActivity.cs @@ -29,7 +29,7 @@ namespace Boilerplate.Client.Maui.Platforms.Android; [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleInstance, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] -public class MainActivity : MauiAppCompatActivity +public partial class MainActivity : MauiAppCompatActivity { protected override void OnCreate(Bundle? savedInstanceState) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/MainApplication.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/MainApplication.cs index cf21ded923..1692a9dc7f 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/MainApplication.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Android/MainApplication.cs @@ -14,7 +14,7 @@ namespace Boilerplate.Client.Maui.Platforms.Android; AllowBackup = true, SupportsRtl = true )] -public class MainApplication : MauiApplication +public partial class MainApplication : MauiApplication { public MainApplication(IntPtr handle, JniHandleOwnership ownership) : base(handle, ownership) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/MacCatalyst/AppDelegate.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/MacCatalyst/AppDelegate.cs index 719caabfe5..f2070bdcf2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/MacCatalyst/AppDelegate.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/MacCatalyst/AppDelegate.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Client.Maui.Platforms.MacCatalyst; [Register(nameof(AppDelegate))] -public class AppDelegate : MauiUIApplicationDelegate +public partial class AppDelegate : MauiUIApplicationDelegate { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/MacCatalyst/Program.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/MacCatalyst/Program.cs index e5afcd391e..737c8a920b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/MacCatalyst/Program.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/MacCatalyst/Program.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Client.Maui.Platforms.MacCatalyst; -public class Program +public partial class Program { static void Main(string[] args) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Tizen/Main.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Tizen/Main.cs index 9df6824bf1..f8b58aa71b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Tizen/Main.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/Tizen/Main.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Client.Maui; -class Program : MauiApplication +partial class Program : MauiApplication { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/iOS/AppDelegate.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/iOS/AppDelegate.cs index 50b67f1cb8..111106e3c6 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/iOS/AppDelegate.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/iOS/AppDelegate.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Client.Maui.Platforms.iOS; [Register(nameof(AppDelegate))] -public class AppDelegate : MauiUIApplicationDelegate +public partial class AppDelegate : MauiUIApplicationDelegate { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/iOS/Program.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/iOS/Program.cs index f9134617b6..9c8431c16a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/iOS/Program.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Platforms/iOS/Program.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Client.Maui.Platforms.iOS; -public class Program +public partial class Program { static void Main(string[] args) { 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 76d97f865f..8362af157f 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 @@ -6,7 +6,7 @@ namespace Boilerplate.Client.Maui.Services; /// /// More info at /// -public class MauiDeviceCoordinator : IBitDeviceCoordinator +public partial class MauiDeviceCoordinator : IBitDeviceCoordinator { public double GetStatusBarHeight() { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiExternalNavigationService.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiExternalNavigationService.cs index 18195583da..471a604039 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiExternalNavigationService.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiExternalNavigationService.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Client.Maui.Services; -public class MauiExternalNavigationService : IExternalNavigationService +public partial class MauiExternalNavigationService : IExternalNavigationService { public async Task NavigateToAsync(string url) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiStorageService.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiStorageService.cs index d069dc3bed..9a7df0cbf1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiStorageService.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiStorageService.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Client.Maui.Services; -public class MauiStorageService : IStorageService +public partial class MauiStorageService : IStorageService { private readonly Dictionary tempStorage = []; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/Services/WebDeviceCoordinator.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/Services/WebDeviceCoordinator.cs index 3f660034ee..99d13301e4 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/Services/WebDeviceCoordinator.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/Services/WebDeviceCoordinator.cs @@ -1,5 +1,5 @@ namespace Boilerplate.Client.Web.Services; -public class WebDeviceCoordinator : IBitDeviceCoordinator +public partial class WebDeviceCoordinator : IBitDeviceCoordinator { } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Configuration/WindowsUpdateSettings.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Configuration/WindowsUpdateSettings.cs index 2e4652123f..f7c46a22b4 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Configuration/WindowsUpdateSettings.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Configuration/WindowsUpdateSettings.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Client.Windows.Configuration; -public class WindowsUpdateSettings +public partial class WindowsUpdateSettings { public bool AutoReload { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsDeviceCoordinator.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsDeviceCoordinator.cs index 5ff3085de5..0f82bf2694 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsDeviceCoordinator.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsDeviceCoordinator.cs @@ -2,4 +2,4 @@ namespace Boilerplate.Client.Windows.Services; -public class WindowsDeviceCoordinator : IBitDeviceCoordinator { } +public partial class WindowsDeviceCoordinator : IBitDeviceCoordinator { } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsStorageService.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsStorageService.cs index 7cf126d8b2..dedc59870a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsStorageService.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsStorageService.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Client.Windows.Services; -public class WindowsStorageService : IStorageService +public partial class WindowsStorageService : IStorageService { private readonly Dictionary tempStorage = []; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsTelemetryInitializer.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsTelemetryInitializer.cs index 031eed7e8d..0117cba282 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsTelemetryInitializer.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsTelemetryInitializer.cs @@ -4,7 +4,7 @@ namespace Boilerplate.Client.Windows.Services; -public class WindowsTelemetryInitializer : ITelemetryInitializer +public partial class WindowsTelemetryInitializer : ITelemetryInitializer { private string sessionId { get; } = Guid.NewGuid().ToString(); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/AppSettings.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/AppSettings.cs index f9de906357..a8d4ec6120 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/AppSettings.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/AppSettings.cs @@ -1,7 +1,7 @@ //+:cnd:noEmit namespace Boilerplate.Server.Api; -public class AppSettings : IValidatableObject +public partial class AppSettings : IValidatableObject { public IdentitySettings Identity { get; set; } = default!; @@ -29,7 +29,7 @@ public IEnumerable Validate(ValidationContext validationContex } } -public class IdentitySettings : IdentityOptions +public partial class IdentitySettings : IdentityOptions { public TimeSpan BearerTokenExpiration { get; set; } public TimeSpan RefreshTokenExpiration { get; set; } @@ -59,7 +59,7 @@ public class IdentitySettings : IdentityOptions public TimeSpan RevokeUserSessionsDelay { get; set; } } -public class EmailSettings +public partial class EmailSettings { [Required] public string Host { get; set; } = default!; @@ -78,7 +78,7 @@ public class EmailSettings public bool HasCredential => (string.IsNullOrEmpty(UserName) is false) && (string.IsNullOrEmpty(Password) is false); } -public class SmsSettings +public partial class SmsSettings { public string? FromPhoneNumber { get; set; } public string? TwilioAccountSid { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs index ec266e18e8..5a0dba6f85 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs @@ -12,7 +12,7 @@ namespace Boilerplate.Server.Api.Data; -public class AppDbContext(DbContextOptions options) +public partial class AppDbContext(DbContextOptions options) : IdentityDbContext(options), IDataProtectionKeyContext { public DbSet DataProtectionKeys { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Category/CategoryConfiguration.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Category/CategoryConfiguration.cs index 9cb9565007..9e099d9f71 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Category/CategoryConfiguration.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Category/CategoryConfiguration.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Server.Api.Data.Configurations.Identity; -public class CategoryConfiguration : IEntityTypeConfiguration +public partial class CategoryConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Identity/RoleConfiguration.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Identity/RoleConfiguration.cs index e71036835f..d22180c85f 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Identity/RoleConfiguration.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Identity/RoleConfiguration.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Server.Api.Data.Configurations.Identity; -public class RoleConfiguration : IEntityTypeConfiguration +public partial class RoleConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { 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 25c050988b..ab26d067fd 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 @@ -4,7 +4,7 @@ namespace Boilerplate.Server.Api.Data.Configurations.Identity; -public class UserConfiguration : IEntityTypeConfiguration +public partial class UserConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/PostgresDateTimeOffsetConverter.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/PostgresDateTimeOffsetConverter.cs index 7ad29713f6..2af56f1a2a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/PostgresDateTimeOffsetConverter.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/PostgresDateTimeOffsetConverter.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Server.Api.Data.Configurations; // Cannot write DateTimeOffset with Offset=XX:XX:XX to PostgreSQL type 'timestamp with time zone', only offset 0 (UTC) is supported. -public class PostgresDateTimeOffsetConverter : ValueConverter +public partial class PostgresDateTimeOffsetConverter : ValueConverter { public PostgresDateTimeOffsetConverter() : base( @@ -13,7 +13,7 @@ public PostgresDateTimeOffsetConverter() } } -public class NullablePostgresDateTimeOffsetConverter : ValueConverter +public partial class NullablePostgresDateTimeOffsetConverter : ValueConverter { public NullablePostgresDateTimeOffsetConverter() : base( 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 c81c801f04..c36a9eee2b 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 @@ -2,7 +2,7 @@ namespace Boilerplate.Server.Api.Data.Configurations.Identity; -public class ProductConfiguration : IEntityTypeConfiguration +public partial class ProductConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/SqlServerPrimaryKeySequentialGuidDefaultValueConvention.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/SqlServerPrimaryKeySequentialGuidDefaultValueConvention.cs index c26d292223..f73b4c0e27 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/SqlServerPrimaryKeySequentialGuidDefaultValueConvention.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/SqlServerPrimaryKeySequentialGuidDefaultValueConvention.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Server.Api.Data.Configurations; -public class SqlServerPrimaryKeySequentialGuidDefaultValueConvention : IModelFinalizingConvention +public partial class SqlServerPrimaryKeySequentialGuidDefaultValueConvention : IModelFinalizingConvention { public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext context) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/HttpRequestExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/HttpRequestExtensions.cs index 2bac45270f..ee4e9cd0d0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/HttpRequestExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/HttpRequestExtensions.cs @@ -2,7 +2,7 @@ namespace Microsoft.AspNetCore.Http; -public static class HttpRequestExtensions +public static partial class HttpRequestExtensions { /// /// https://blog.elmah.io/how-to-get-base-url-in-asp-net-core/ diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/SignInManagerExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/SignInManagerExtensions.cs index 43bb79de7f..3795ead415 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/SignInManagerExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/SignInManagerExtensions.cs @@ -3,7 +3,7 @@ namespace Microsoft.AspNetCore.Identity; -public static class SignInManagerExtensions +public static partial class SignInManagerExtensions { public static async Task OtpSignInAsync(this SignInManager signInManager, User user, string otp) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/UserManagerExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/UserManagerExtensions.cs index bf9c9bedcd..e9d3157249 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/UserManagerExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Extensions/UserManagerExtensions.cs @@ -3,7 +3,7 @@ namespace Microsoft.AspNetCore.Identity; -public static class UserManagerExtensions +public static partial class UserManagerExtensions { public static async Task FindUserAsync(this UserManager userManager, IdentityRequestDto identity) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/IdentityHub.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/IdentityHub.cs index f0558ab445..8e0b4a8420 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/IdentityHub.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/IdentityHub.cs @@ -3,6 +3,6 @@ namespace Boilerplate.Server.Api.Hubs; [Authorize] -public class IdentityHub : Hub +public partial class IdentityHub : Hub { } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Categories/Category.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Categories/Category.cs index 8b421f53fb..d41575eb7f 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Categories/Category.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Categories/Category.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Server.Api.Models.Categories; -public class Category +public partial class Category { public Guid Id { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/EmailTokenTemplateModel.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/EmailTokenTemplateModel.cs index 95ab4538b1..9f6d215cc1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/EmailTokenTemplateModel.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/EmailTokenTemplateModel.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Server.Api.Models.Emailing; -public class EmailTokenTemplateModel +public partial class EmailTokenTemplateModel { public string? Email { get; set; } public string? Token { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/OtpTemplateModel.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/OtpTemplateModel.cs index 8e27512503..e5799c72ac 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/OtpTemplateModel.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/OtpTemplateModel.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Server.Api.Models.Emailing; -public class OtpTemplateModel +public partial class OtpTemplateModel { public string? DisplayName { get; set; } public required string Token { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/ResetPasswordTokenTemplateModel.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/ResetPasswordTokenTemplateModel.cs index 3dd229a3f6..6190d5a644 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/ResetPasswordTokenTemplateModel.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/ResetPasswordTokenTemplateModel.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Server.Api.Models.Emailing; -public class ResetPasswordTokenTemplateModel +public partial class ResetPasswordTokenTemplateModel { public string? DisplayName { get; set; } public required string Token { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/TwoFactorTokenTemplateModel.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/TwoFactorTokenTemplateModel.cs index c360bf5149..3e40b671b2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/TwoFactorTokenTemplateModel.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Emailing/TwoFactorTokenTemplateModel.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Server.Api.Models.Emailing; -public class TwoFactorTokenTemplateModel +public partial class TwoFactorTokenTemplateModel { public required string DisplayName { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/Role.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/Role.cs index 5b174ab553..1912d55736 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/Role.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/Role.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Server.Api.Models.Identity; -public class Role : IdentityRole +public partial class Role : IdentityRole { } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/User.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/User.cs index 8cd9148178..86a60d36cf 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/User.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/User.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Server.Api.Models.Identity; -public class User : IdentityUser +public partial class User : IdentityUser { [PersonalData] public string? FullName { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/UserSession.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/UserSession.cs index 1afceaba19..efe7eedccc 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/UserSession.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Identity/UserSession.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Server.Api.Models.Identity; -public class UserSession +public partial class UserSession { public Guid SessionUniqueId { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Products/Product.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Products/Product.cs index ebb3a73654..ed66a9e53d 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Products/Product.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Products/Product.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Server.Api.Models.Products; -public class Product +public partial class Product { public Guid Id { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Todo/TodoItem.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Todo/TodoItem.cs index d1704db37f..5cbc0dff91 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Todo/TodoItem.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Todo/TodoItem.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Server.Api.Models.Todo; -public class TodoItem +public partial class TodoItem { public Guid Id { get; set; } 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 ff87b23e2e..56fe5ecdd7 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 @@ -7,7 +7,7 @@ namespace Boilerplate.Server.Api.Services; /// /// Stores bearer token in jwt format /// -public class AppSecureJwtDataFormat(AppSettings appSettings, TokenValidationParameters validationParameters) +public partial class AppSecureJwtDataFormat(AppSettings appSettings, TokenValidationParameters validationParameters) : ISecureDataFormat { public AuthenticationTicket? Unprotect(string? protectedText) => Unprotect(protectedText, null); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppUserClaimsPrincipalFactory.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppUserClaimsPrincipalFactory.cs index 608e7bb9eb..fb8ddb7f98 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppUserClaimsPrincipalFactory.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppUserClaimsPrincipalFactory.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Server.Api.Services; -public class AppUserClaimsPrincipalFactory(UserManager userManager, IOptions optionsAccessor) +public partial class AppUserClaimsPrincipalFactory(UserManager userManager, IOptions optionsAccessor) : UserClaimsPrincipalFactory(userManager, optionsAccessor) { /// diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppUserConfirmation.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppUserConfirmation.cs index 0651323250..14a4f64f87 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppUserConfirmation.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/AppUserConfirmation.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Server.Api.Services; -public class AppUserConfirmation : IUserConfirmation +public partial class AppUserConfirmation : IUserConfirmation { public async Task IsConfirmedAsync(UserManager manager, User user) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/GoogleRecaptchaVerificationResponse.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/GoogleRecaptchaVerificationResponse.cs index 092dbbc9ed..ed7ca77c08 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/GoogleRecaptchaVerificationResponse.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/GoogleRecaptchaVerificationResponse.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Server.Api.Services; -public class GoogleRecaptchaVerificationResponse +public partial class GoogleRecaptchaVerificationResponse { public bool Success { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/ODataOperationFilter.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/ODataOperationFilter.cs index 323d179ecf..cc04f6ddff 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/ODataOperationFilter.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/ODataOperationFilter.cs @@ -7,7 +7,7 @@ namespace Boilerplate.Server.Api.Services; /// /// https://docs.microsoft.com/en-us/odata/concepts/queryoptions-overview /// -public class ODataOperationFilter : IOperationFilter +public partial class ODataOperationFilter : IOperationFilter { public void Apply(OpenApiOperation operation, OperationFilterContext context) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs index 289dc03b85..dcd8b949b2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs @@ -3,7 +3,7 @@ namespace Microsoft.AspNetCore.Http; -public static class HttpRequestExtensions +public static partial class HttpRequestExtensions { /// /// https://blog.elmah.io/how-to-get-base-url-in-asp-net-core/ diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Attributes/AutoInjectAttribute.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Attributes/AutoInjectAttribute.cs index 65d16737c5..2a7e559268 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Attributes/AutoInjectAttribute.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Attributes/AutoInjectAttribute.cs @@ -5,6 +5,6 @@ /// generate the remaining code necessary to inject that field or property using dependency injection. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = false, AllowMultiple = false)] -public sealed class AutoInjectAttribute : Attribute +public sealed partial class AutoInjectAttribute : Attribute { } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Attributes/DtoResourceTypeAttribute.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Attributes/DtoResourceTypeAttribute.cs index a9a9ab5cb8..d904da6753 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Attributes/DtoResourceTypeAttribute.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Attributes/DtoResourceTypeAttribute.cs @@ -5,7 +5,7 @@ /// you can streamline the process by applying this attribute to the class just once. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] -public class DtoResourceTypeAttribute(Type resourceType) : Attribute +public partial class DtoResourceTypeAttribute(Type resourceType) : Attribute { public Type ResourceType { get; } = resourceType ?? throw new ArgumentNullException(nameof(resourceType)); } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Controllers/Attributes.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Controllers/Attributes.cs index 633d4ab243..55a18795a7 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Controllers/Attributes.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Controllers/Attributes.cs @@ -1,37 +1,37 @@ namespace Boilerplate.Shared.Controllers; [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method)] -internal class RouteAttribute(string template) : Attribute +internal partial class RouteAttribute(string template) : Attribute { public string Template { get; } = template; } [AttributeUsage(AttributeTargets.Method)] -internal class HttpGetAttribute(string? template = null) : Attribute +internal partial class HttpGetAttribute(string? template = null) : Attribute { public string? Template { get; } = template; } [AttributeUsage(AttributeTargets.Method)] -internal class HttpPostAttribute(string? template = null) : Attribute +internal partial class HttpPostAttribute(string? template = null) : Attribute { public string? Template { get; } = template; } [AttributeUsage(AttributeTargets.Method)] -internal class HttpPutAttribute(string? template = null) : Attribute +internal partial class HttpPutAttribute(string? template = null) : Attribute { public string? Template { get; } = template; } [AttributeUsage(AttributeTargets.Method)] -internal class HttpDeleteAttribute(string? template = null) : Attribute +internal partial class HttpDeleteAttribute(string? template = null) : Attribute { public string? Template { get; } = template; } [AttributeUsage(AttributeTargets.Method)] -internal class HttpPatchAttribute(string? template = null) : Attribute +internal partial class HttpPatchAttribute(string? template = null) : Attribute { public string? Template { get; } = template; } @@ -41,7 +41,7 @@ internal class HttpPatchAttribute(string? template = null) : Attribute /// /// [AttributeUsage(AttributeTargets.Method)] -public class NoRetryPolicyAttribute : Attribute +public partial class NoRetryPolicyAttribute : Attribute { } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Categories/CategoryDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Categories/CategoryDto.cs index 278d0d52a8..91b296fa8d 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Categories/CategoryDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Categories/CategoryDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Categories; [DtoResourceType(typeof(AppStrings))] -public class CategoryDto +public partial class CategoryDto { public Guid Id { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/OverallAnalyticsStatsDataResponseDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/OverallAnalyticsStatsDataResponseDto.cs index 5195d12e8b..c130f412e9 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/OverallAnalyticsStatsDataResponseDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/OverallAnalyticsStatsDataResponseDto.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Dtos.Dashboard; -public class OverallAnalyticsStatsDataResponseDto +public partial class OverallAnalyticsStatsDataResponseDto { public int Last30DaysProductCount { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductPercentagePerCategoryResponseDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductPercentagePerCategoryResponseDto.cs index 68cee4f65b..e141f4f094 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductPercentagePerCategoryResponseDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductPercentagePerCategoryResponseDto.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Dtos.Dashboard; -public class ProductPercentagePerCategoryResponseDto +public partial class ProductPercentagePerCategoryResponseDto { public string? CategoryName { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductSaleStatResponseDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductSaleStatResponseDto.cs index 64bbc6df34..9b69235541 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductSaleStatResponseDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductSaleStatResponseDto.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Dtos.Dashboard; -public class ProductSaleStatResponseDto +public partial class ProductSaleStatResponseDto { public string? ProductName { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductsCountPerCategoryResponseDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductsCountPerCategoryResponseDto.cs index 6532b34290..945b7df981 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductsCountPerCategoryResponseDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Dashboard/ProductsCountPerCategoryResponseDto.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Dtos.Dashboard; -public class ProductsCountPerCategoryResponseDto +public partial class ProductsCountPerCategoryResponseDto { public string? CategoryName { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ChangePasswordRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ChangePasswordRequestDto.cs index 9d26a1e25f..b13f2156b3 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ChangePasswordRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ChangePasswordRequestDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class ChangePasswordRequestDto +public partial class ChangePasswordRequestDto { [Required(ErrorMessage = nameof(AppStrings.RequiredAttribute_ValidationError))] [MinLength(6, ErrorMessage = nameof(AppStrings.MinLengthAttribute_ValidationError))] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ChangeUserNameRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ChangeUserNameRequestDto.cs index dd0eeb7ffd..849ce8d4ff 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ChangeUserNameRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ChangeUserNameRequestDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class ChangeUserNameRequestDto +public partial class ChangeUserNameRequestDto { /// new [Display(Name = nameof(AppStrings.UserName))] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ConfirmEmailRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ConfirmEmailRequestDto.cs index 0c81399e4b..b77a56ab74 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ConfirmEmailRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ConfirmEmailRequestDto.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class ConfirmEmailRequestDto +public partial class ConfirmEmailRequestDto { [Required(ErrorMessage = nameof(AppStrings.RequiredAttribute_ValidationError))] [EmailAddress(ErrorMessage = nameof(AppStrings.EmailAddressAttribute_ValidationError))] @@ -13,7 +13,7 @@ public class ConfirmEmailRequestDto public string? Token { get; set; } } -public class ChangeEmailRequestDto : ConfirmEmailRequestDto +public partial class ChangeEmailRequestDto : ConfirmEmailRequestDto { // This class needs the same set of properties as ConfirmEmailRequestDto } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ConfirmPhoneRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ConfirmPhoneRequestDto.cs index 3e1d54c450..7ebab421d3 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ConfirmPhoneRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ConfirmPhoneRequestDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class ConfirmPhoneRequestDto +public partial class ConfirmPhoneRequestDto { [Required(ErrorMessage = nameof(AppStrings.RequiredAttribute_ValidationError))] [Phone(ErrorMessage = nameof(AppStrings.PhoneAttribute_ValidationError))] @@ -12,7 +12,7 @@ public class ConfirmPhoneRequestDto public string? Token { get; set; } } -public class ChangePhoneNumberRequestDto : ConfirmPhoneRequestDto +public partial class ChangePhoneNumberRequestDto : ConfirmPhoneRequestDto { // This class needs the same set of properties as ConfirmPhoneNumberRequestDto } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/EditUserDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/EditUserDto.cs index a23399bb85..cfc8b01468 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/EditUserDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/EditUserDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class EditUserDto +public partial class EditUserDto { [Required(ErrorMessage = nameof(AppStrings.RequiredAttribute_ValidationError))] [Display(Name = nameof(AppStrings.FullName))] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/IdentityRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/IdentityRequestDto.cs index cb65e38506..961b1c0c8a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/IdentityRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/IdentityRequestDto.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class IdentityRequestDto : IValidatableObject +public partial class IdentityRequestDto : IValidatableObject { /// test [Display(Name = nameof(AppStrings.UserName))] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/RefreshRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/RefreshRequestDto.cs index 44392762bb..ebf4fc39a2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/RefreshRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/RefreshRequestDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class RefreshRequestDto +public partial class RefreshRequestDto { [Required(ErrorMessage = nameof(AppStrings.RequiredAttribute_ValidationError))] public string? RefreshToken { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ResetPasswordRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ResetPasswordRequestDto.cs index f7dd1c0711..01ecf6f88f 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ResetPasswordRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/ResetPasswordRequestDto.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class ResetPasswordRequestDto : IdentityRequestDto +public partial class ResetPasswordRequestDto : IdentityRequestDto { [Required(ErrorMessage = nameof(AppStrings.RequiredAttribute_ValidationError))] public string? Token { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendEmailTokenRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendEmailTokenRequestDto.cs index b4b1e40eaf..6f1ad5cfb5 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendEmailTokenRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendEmailTokenRequestDto.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class SendEmailTokenRequestDto +public partial class SendEmailTokenRequestDto { [Required(ErrorMessage = nameof(AppStrings.RequiredAttribute_ValidationError))] [EmailAddress(ErrorMessage = nameof(AppStrings.EmailAddressAttribute_ValidationError))] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendPhoneTokenRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendPhoneTokenRequestDto.cs index 29e6f3abbc..48d805b52b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendPhoneTokenRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendPhoneTokenRequestDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class SendPhoneTokenRequestDto +public partial class SendPhoneTokenRequestDto { [Required(ErrorMessage = nameof(AppStrings.RequiredAttribute_ValidationError))] [Phone(ErrorMessage = nameof(AppStrings.PhoneAttribute_ValidationError))] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendResetPasswordTokenRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendResetPasswordTokenRequestDto.cs index e787111fe0..da9acc6f0d 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendResetPasswordTokenRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SendResetPasswordTokenRequestDto.cs @@ -2,6 +2,6 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class SendResetPasswordTokenRequestDto : IdentityRequestDto +public partial class SendResetPasswordTokenRequestDto : IdentityRequestDto { } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignInRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignInRequestDto.cs index f310ea248c..48f1d816e0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignInRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignInRequestDto.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class SignInRequestDto : IdentityRequestDto +public partial class SignInRequestDto : IdentityRequestDto { /// 123456 [Display(Name = nameof(AppStrings.Password))] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignInResponseDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignInResponseDto.cs index 5c306a8f9f..c61c45d06a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignInResponseDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignInResponseDto.cs @@ -1,7 +1,7 @@  namespace Boilerplate.Shared.Dtos.Identity; -public class SignInResponseDto : TokenResponseDto +public partial class SignInResponseDto : TokenResponseDto { public bool RequiresTwoFactor { get; set; } } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignUpRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignUpRequestDto.cs index 094f6108ff..bd4ad95323 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignUpRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/SignUpRequestDto.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class SignUpRequestDto : IdentityRequestDto +public partial class SignUpRequestDto : IdentityRequestDto { /// test2 [Required(ErrorMessage = nameof(AppStrings.RequiredAttribute_ValidationError))] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TokenResponseDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TokenResponseDto.cs index e5031d6e37..32ab88cecf 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TokenResponseDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TokenResponseDto.cs @@ -1,7 +1,7 @@  namespace Boilerplate.Shared.Dtos.Identity; -public class TokenResponseDto +public partial class TokenResponseDto { public string? TokenType { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TwoFactorAuthRequestDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TwoFactorAuthRequestDto.cs index e824bff1d9..c668efbf9a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TwoFactorAuthRequestDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TwoFactorAuthRequestDto.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Dtos.Identity; -public class TwoFactorAuthRequestDto +public partial class TwoFactorAuthRequestDto { public bool? Enable { get; init; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TwoFactorAuthResponseDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TwoFactorAuthResponseDto.cs index 3b7623d49b..f3cb50c9ef 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TwoFactorAuthResponseDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/TwoFactorAuthResponseDto.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Dtos.Identity; -public class TwoFactorAuthResponseDto +public partial class TwoFactorAuthResponseDto { public required string SharedKey { get; init; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/UserDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/UserDto.cs index cf19937cfb..aef0fd6457 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/UserDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/UserDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Identity; [DtoResourceType(typeof(AppStrings))] -public class UserDto : IValidatableObject +public partial class UserDto : IValidatableObject { public Guid Id { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/UserSessionDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/UserSessionDto.cs index 1232207ea2..cb7b7c6d67 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/UserSessionDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Identity/UserSessionDto.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Dtos.Identity; -public class UserSessionDto +public partial class UserSessionDto { public Guid SessionUniqueId { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/PagedResultDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/PagedResultDto.cs index c3ebdd935c..73edf72151 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/PagedResultDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/PagedResultDto.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Dtos; -public class PagedResult +public partial class PagedResult { public T[] Items { get; set; } = []; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Products/ProductDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Products/ProductDto.cs index 7d61a8e462..c7ef12a4d2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Products/ProductDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Products/ProductDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Products; [DtoResourceType(typeof(AppStrings))] -public class ProductDto +public partial class ProductDto { public Guid Id { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Todo/TodoItemDto.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Todo/TodoItemDto.cs index 387c0ab9b3..d5f9f896d1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Todo/TodoItemDto.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Todo/TodoItemDto.cs @@ -1,7 +1,7 @@ namespace Boilerplate.Shared.Dtos.Todo; [DtoResourceType(typeof(AppStrings))] -public class TodoItemDto +public partial class TodoItemDto { public Guid Id { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/BadRequestException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/BadRequestException.cs index 42e71122ff..1c7cdcba71 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/BadRequestException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/BadRequestException.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Exceptions; -public class BadRequestException : RestException +public partial class BadRequestException : RestException { public BadRequestException() : base(nameof(AppStrings.BadRequestException)) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ConflictException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ConflictException.cs index 88f0794e91..d467614ec1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ConflictException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ConflictException.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Exceptions; -public class ConflictException : RestException +public partial class ConflictException : RestException { public ConflictException() : this(nameof(AppStrings.ConflictException)) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/DomainLogicException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/DomainLogicException.cs index 9e50aee1ae..c931776a05 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/DomainLogicException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/DomainLogicException.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Exceptions; -public class DomainLogicException : KnownException +public partial class DomainLogicException : KnownException { public DomainLogicException(string message) : base(message) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ErrorResourcePayload.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ErrorResourcePayload.cs index 6806514b21..13934795cf 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ErrorResourcePayload.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ErrorResourcePayload.cs @@ -1,20 +1,20 @@ namespace Boilerplate.Shared.Exceptions; -public class ErrorResourcePayload +public partial class ErrorResourcePayload { public string? ResourceTypeName { get; set; } = "*"; public List Details { get; set; } = []; } -public class PropertyErrorResourceCollection +public partial class PropertyErrorResourceCollection { public string? Name { get; set; } = "*"; public List Errors { get; set; } = []; } -public class ErrorResource +public partial class ErrorResource { public string? Key { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ForbiddenException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ForbiddenException.cs index 7d1a5d1063..d17e403ba1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ForbiddenException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ForbiddenException.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Exceptions; -public class ForbiddenException : RestException +public partial class ForbiddenException : RestException { public ForbiddenException() : base(nameof(AppStrings.ForbiddenException)) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/KnownException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/KnownException.cs index 9830413e59..24dcb58c4f 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/KnownException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/KnownException.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Exceptions; -public abstract class KnownException : Exception +public abstract partial class KnownException : Exception { public KnownException(string message) : base(message) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ResourceNotFoundException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ResourceNotFoundException.cs index e23373ed7b..5bf5c41e05 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ResourceNotFoundException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ResourceNotFoundException.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Exceptions; -public class ResourceNotFoundException : RestException +public partial class ResourceNotFoundException : RestException { public ResourceNotFoundException() : base(nameof(AppStrings.ResourceNotFoundException)) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ResourceValidationException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ResourceValidationException.cs index 822e449420..93cd8ed66b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ResourceValidationException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ResourceValidationException.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Exceptions; -public class ResourceValidationException : RestException +public partial class ResourceValidationException : RestException { public ResourceValidationException(params LocalizedString[] errorMessages) : this([("*", errorMessages)]) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/RestErrorInfo.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/RestErrorInfo.cs index 90216aa959..52081ddcad 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/RestErrorInfo.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/RestErrorInfo.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Exceptions; -public class RestErrorInfo +public partial class RestErrorInfo { public string? ExceptionType { get; set; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/RestException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/RestException.cs index 35b8537736..e24e3a207f 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/RestException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/RestException.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Exceptions; -public class RestException : KnownException +public partial class RestException : KnownException { public RestException() : base(nameof(AppStrings.RestException)) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ServerConnectionException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ServerConnectionException.cs index 6cc7655dc1..df8f53738b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ServerConnectionException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ServerConnectionException.cs @@ -1,5 +1,5 @@ namespace Boilerplate.Shared.Exceptions; -public class ServerConnectionException : KnownException +public partial class ServerConnectionException : KnownException { public ServerConnectionException() : base(nameof(AppStrings.ServerConnectionException)) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/TooManyRequestsExceptions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/TooManyRequestsExceptions.cs index c9d2fdc2b1..9766e0bf7a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/TooManyRequestsExceptions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/TooManyRequestsExceptions.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Exceptions; -public class TooManyRequestsExceptions : RestException +public partial class TooManyRequestsExceptions : RestException { public TooManyRequestsExceptions() : base(nameof(AppStrings.TooManyRequestsExceptions)) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/UnauthorizedException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/UnauthorizedException.cs index cd3e687a21..4389698881 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/UnauthorizedException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/UnauthorizedException.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Exceptions; -public class UnauthorizedException : RestException +public partial class UnauthorizedException : RestException { public UnauthorizedException() : base(nameof(AppStrings.UnauthorizedException)) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/UnknownException.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/UnknownException.cs index d56c660860..866e0012bb 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/UnknownException.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/UnknownException.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Exceptions; -public class UnknownException : Exception +public partial class UnknownException : Exception { public UnknownException() : base(nameof(AppStrings.UnknownException)) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/ClaimsPrincipalExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/ClaimsPrincipalExtensions.cs index 6387afd2f7..130b4c2069 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/ClaimsPrincipalExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/ClaimsPrincipalExtensions.cs @@ -1,6 +1,6 @@ namespace System.Security.Claims; -public static class ClaimsPrincipalExtensions +public static partial class ClaimsPrincipalExtensions { public static bool IsAuthenticated(this ClaimsPrincipal? claimsPrincipal) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/ICollectionExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/ICollectionExtensions.cs index d2adc07f63..dc6dc90165 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/ICollectionExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/ICollectionExtensions.cs @@ -1,6 +1,6 @@ namespace System.Collections.Generic; -public static class ICollectionExtensions +public static partial class ICollectionExtensions { // Basically a Polyfill since we now expose IList instead of List // which is better but IList doesn't have AddRange diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IConfigurationBuilderExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IConfigurationBuilderExtensions.cs index 5e81356a4a..cc8d34392c 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IConfigurationBuilderExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IConfigurationBuilderExtensions.cs @@ -2,7 +2,7 @@ namespace Microsoft.Extensions.Configuration; -public static class IConfigurationBuilderExtensions +public static partial class IConfigurationBuilderExtensions { /// /// Configuration priority (Lowest to highest) => diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IConfigurationExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IConfigurationExtensions.cs index dd6fb5a9cc..723dc2cf28 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IConfigurationExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IConfigurationExtensions.cs @@ -1,6 +1,6 @@ //-:cnd:noEmit namespace Microsoft.Extensions.Configuration; -public static class IConfigurationExtensions +public static partial class IConfigurationExtensions { public static T GetRequiredValue(this IConfiguration configuration, string name) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IServiceCollectionExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IServiceCollectionExtensions.cs index 6f74df24a9..88d79c75a0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IServiceCollectionExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/IServiceCollectionExtensions.cs @@ -2,7 +2,7 @@ namespace Microsoft.Extensions.DependencyInjection; -public static class IServiceCollectionExtensions +public static partial class IServiceCollectionExtensions { public static IServiceCollection AddSharedProjectServices(this IServiceCollection services) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/JsonSeralizerExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/JsonSeralizerExtensions.cs index 0562dda9e6..3f5745420d 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/JsonSeralizerExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/JsonSeralizerExtensions.cs @@ -2,7 +2,7 @@ namespace System.Text.Json; -public static class JsonSerializerOptionsExtensions +public static partial class JsonSerializerOptionsExtensions { /// /// https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-source-generator/ diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/LinqExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/LinqExtensions.cs index 718221b8fc..4941350b3a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/LinqExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/LinqExtensions.cs @@ -2,7 +2,7 @@ namespace System.Collections.Generic; -public static class LinqExtensions +public static partial class LinqExtensions { /// /// https://extensionmethod.net/csharp/ienumerable-t/whereif diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/TupleExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/TupleExtensions.cs index 28228f43ad..a81cd2fc1c 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/TupleExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/TupleExtensions.cs @@ -10,7 +10,7 @@ namespace System.Threading.Tasks; /// promoting a streamlined and efficient workflow across various functionalities. /// /// As an alternative to the following code: -/// public class MyPage : AppComponentBase +/// public partial class MyPage : AppComponentBase /// { /// CategoryDto[] categories; /// ProductDto[] products; @@ -23,7 +23,7 @@ namespace System.Threading.Tasks; /// } /// /// You can now employ the following concise approach: -/// public class MyPage : AppComponentBase +/// public partial class MyPage : AppComponentBase /// { /// CategoryDto[] categories; /// ProductDto[] products; @@ -34,7 +34,7 @@ namespace System.Threading.Tasks; /// } /// } /// -public static class TupleExtensions +public static partial class TupleExtensions { public static TaskAwaiter<(T1, T2)> GetAwaiter(this (Task, Task) tuple) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/StringLocalizerProvider.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/StringLocalizerProvider.cs index a332f08549..261a33e52e 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/StringLocalizerProvider.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/StringLocalizerProvider.cs @@ -1,7 +1,7 @@ using System.Reflection; namespace Boilerplate.Shared.Resources; -public static class StringLocalizerProvider +public static partial class StringLocalizerProvider { public static IStringLocalizer ProvideLocalizer(Type dtoType, IStringLocalizerFactory factory) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/AppEnvironment.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/AppEnvironment.cs index e3b811bce1..638ef21103 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/AppEnvironment.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/AppEnvironment.cs @@ -9,7 +9,7 @@ namespace Boilerplate.Shared.Services; /// Blazor Server, and Blazor WebAssembly (WASM). /// Additionally, in Blazor Hybrid, it stays in sync with the build configuration (Debug, Release). /// -public static class AppEnvironment +public static partial class AppEnvironment { const string DEV = "Development"; const string STAGING = "Staging"; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/CultureInfoManager.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/CultureInfoManager.cs index 68bac7a289..505e882b24 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/CultureInfoManager.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/CultureInfoManager.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Shared.Services; -public class CultureInfoManager +public partial class CultureInfoManager { /// /// To enable/disable multilingual support, navigate to Directory.Build.props and modify the MultilingualEnabled flag. diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/DateTimeProvider.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/DateTimeProvider.cs index cc4fef79de..17c934f817 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/DateTimeProvider.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/DateTimeProvider.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Shared.Services; -public class DateTimeProvider : IDateTimeProvider +public partial class DateTimeProvider : IDateTimeProvider { public DateTimeOffset GetCurrentDateTime() { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Urls.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Urls.cs index 35829056eb..8f8d58d070 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Urls.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Urls.cs @@ -1,7 +1,7 @@ //+:cnd:noEmit namespace Boilerplate.Shared; -public static class Urls +public static partial class Urls { public const string HomePage = "/"; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/AppTestServer.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/AppTestServer.cs index 2e8c67146d..a8ffeceb43 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/AppTestServer.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/AppTestServer.cs @@ -6,7 +6,7 @@ namespace Boilerplate.Tests; -public class AppTestServer : IAsyncDisposable +public partial class AppTestServer : IAsyncDisposable { private TestServer? testServer; private WebApplication? webApp; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/SampleApiTest.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/SampleApiTest.cs index 28d0d291c1..b57b5d245e 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/SampleApiTest.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/SampleApiTest.cs @@ -3,7 +3,7 @@ namespace Boilerplate.Tests; [TestClass] -public class SampleApiTest +public partial class SampleApiTest { [TestMethod] public async Task SignInTest() From 2dada3c98707dbaedaa52c03ee189d66651bf69b Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sat, 14 Sep 2024 23:19:29 +0200 Subject: [PATCH 2/7] Refactor Boilerplate signalr implementation (#8557) --- .../.template.config/template.json | 3 +- .../Pages/Identity/Profile/ProfilePage.razor | 6 +- .../Identity/Profile/ProfilePage.razor.cs | 43 ----------- .../Components/SignalRHandler.cs | 72 +++++++++++++++++++ .../Boilerplate.Client.Core/Routes.razor | 6 +- .../Identity/IdentityController.cs | 10 +-- .../Hubs/{IdentityHub.cs => AppHub.cs} | 4 +- .../Program.Middlewares.cs | 2 +- .../Program.Middlewares.cs | 2 +- .../src/Shared/Resources/AppStrings.fa.resx | 7 +- .../src/Shared/Resources/AppStrings.fr.resx | 7 +- .../src/Shared/Resources/AppStrings.resx | 7 +- 12 files changed, 95 insertions(+), 74 deletions(-) create mode 100644 src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs rename src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/{IdentityHub.cs => AppHub.cs} (62%) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json b/src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json index 779dabd726..b69f6fd967 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json +++ b/src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json @@ -401,7 +401,8 @@ { "condition": "(signalr != true)", "exclude": [ - "src/Server/Boilerplate.Server.Api/Hubs/**" + "src/Server/Boilerplate.Server.Api/Hubs/**", + "src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs" ] }, { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Profile/ProfilePage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Profile/ProfilePage.razor index 50df2ccaf5..4ecef90a33 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Profile/ProfilePage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Profile/ProfilePage.razor @@ -38,8 +38,4 @@
- - -@*#if (signalr == true)*@ - -@*#endif*@ \ No newline at end of file + \ No newline at end of file diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Profile/ProfilePage.razor.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Profile/ProfilePage.razor.cs index 0ed3dd6c17..21aa017abb 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Profile/ProfilePage.razor.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Profile/ProfilePage.razor.cs @@ -1,7 +1,4 @@ //+:cnd:noEmit -//#if (signalr == true) -using Microsoft.AspNetCore.SignalR.Client; -//#endif using Boilerplate.Shared.Dtos.Identity; using Boilerplate.Shared.Controllers.Identity; @@ -12,10 +9,6 @@ public partial class ProfilePage { private UserDto? user; private bool isLoading; - //#if (signalr == true) - private HubConnection? hubConnection; - private BitSnackBar snackBar = default!; - //#endif [AutoInject] private IUserController userController = default!; @@ -35,40 +28,4 @@ protected override async Task OnInitAsync() await base.OnInitAsync(); } - - //#if (signalr == true) - protected async override Task OnAfterFirstRenderAsync() - { - await base.OnAfterFirstRenderAsync(); - - var access_token = await AuthTokenProvider.GetAccessTokenAsync(); - - hubConnection = new HubConnectionBuilder() - .WithUrl($"{Configuration.GetServerAddress()}/identity-hub?access_token={access_token}") - .Build(); - - hubConnection.On("NewUserSession", async (userSession) => - { - await snackBar.Info(Localizer[nameof(AppStrings.NewUserSessionSnackbarTitle)], Localizer[nameof(AppStrings.DeviceDetails), userSession.Device!]); - - // The following code block is not required for Bit.BlazorUI components to perform UI changes. However, it may be necessary in other scenarios. - /*await InvokeAsync(async () => - { - StateHasChanged(); - });*/ - }); - - await hubConnection.StartAsync(); - } - - protected override async ValueTask DisposeAsync(bool disposing) - { - if (hubConnection is not null) - { - await hubConnection.DisposeAsync(); - } - - await base.DisposeAsync(disposing); - } - //#endif } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs new file mode 100644 index 0000000000..65f7ed2c56 --- /dev/null +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs @@ -0,0 +1,72 @@ +using Boilerplate.Shared.Dtos.Identity; +using Microsoft.AspNetCore.SignalR.Client; + +namespace Boilerplate.Client.Core.Components; + +public partial class SignalRHandler : AppComponentBase +{ + [AutoInject] private MessageBoxService messageBoxService = default!; + [AutoInject] private AuthenticationManager authManager = default!; + + private HubConnection? hubConnection; + + protected async override Task OnAfterFirstRenderAsync() + { + await base.OnAfterFirstRenderAsync(); + + authManager.AuthenticationStateChanged += IsUserAuthenticated; + + await ConnectSignalR(); + } + + private async void IsUserAuthenticated(Task task) + { + try + { + await ConnectSignalR(); + } + catch (Exception ex) + { + ExceptionHandler.Handle(ex); + } + } + + private async Task ConnectSignalR() + { + if (hubConnection is not null) + { + await hubConnection.DisposeAsync(); + } + + var access_token = await AuthTokenProvider.GetAccessTokenAsync(); + + hubConnection = new HubConnectionBuilder() + .WithUrl($"{Configuration.GetServerAddress()}/identity-hub?access_token={access_token}") + .Build(); + + hubConnection.On("TwoFactorToken", async (token) => + { + await messageBoxService.Show(Localizer[nameof(AppStrings.TwoFactorTokenPushText), token]); + + // The following code block is not required for Bit.BlazorUI components to perform UI changes. However, it may be necessary in other scenarios. + /*await InvokeAsync(async () => + { + StateHasChanged(); + });*/ + + // You can also leverage IPubSubService to notify other components in the application. + }); + + await hubConnection.StartAsync(CurrentCancellationToken); + } + + protected override async ValueTask DisposeAsync(bool disposing) + { + if (hubConnection is not null) + { + await hubConnection.DisposeAsync(); + } + + await base.DisposeAsync(disposing); + } +} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor index 40eacae7b0..fa3869cfe2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor @@ -1,5 +1,9 @@ - +@*+:cnd:noEmit*@ + + @*#if (signalr == true)*@ + + @*#endif*@ diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs index e6a0dc4754..d406468ad0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs @@ -24,7 +24,7 @@ public partial class IdentityController : AppControllerBase, IIdentityController [AutoInject] private IOptionsMonitor bearerTokenOptions = default!; [AutoInject] private IUserClaimsPrincipalFactory userClaimsPrincipalFactory = default!; //#if (signalr == true) - [AutoInject] private IHubContext identityHubContext = default!; + [AutoInject] private IHubContext appHubContext = default!; //#endif //#if (captcha == "reCaptcha") @@ -146,10 +146,6 @@ public async Task SignIn(SignInRequestDto request, CancellationToken cancellatio var addUserSessionResult = await userManager.UpdateAsync(user); if (addUserSessionResult.Succeeded is false) throw new ResourceValidationException(addUserSessionResult.Errors.Select(e => new LocalizedString(e.Code, e.Description)).ToArray()); - - //#if (signalr == true) - await identityHubContext.Clients.User(user.Id.ToString()).SendAsync("NewUserSession", userSession, cancellationToken); - //#endif } /// @@ -301,6 +297,10 @@ async Task SendSms() } } + //#if (signalr == true) + await appHubContext.Clients.User(user.Id.ToString()).SendAsync("TwoFactorToken", token, cancellationToken); + //#endif + await Task.WhenAll([SendEmail(), SendSms()]); } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/IdentityHub.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/AppHub.cs similarity index 62% rename from src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/IdentityHub.cs rename to src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/AppHub.cs index 8e0b4a8420..d9ec736bb1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/IdentityHub.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Hubs/AppHub.cs @@ -2,7 +2,7 @@ namespace Boilerplate.Server.Api.Hubs; -[Authorize] -public partial class IdentityHub : Hub +[AllowAnonymous] +public partial class AppHub : Hub { } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Middlewares.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Middlewares.cs index 51d3e9bd57..693ba3e1f7 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Middlewares.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Middlewares.cs @@ -65,7 +65,7 @@ public static void ConfiureMiddlewares(this WebApplication app) }).WithTags("Test"); //#if (signalr == true) - app.MapHub("/identity-hub"); + app.MapHub("/identity-hub"); //#endif app.MapControllers().RequireAuthorization(); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs index bfc0d73bc2..3a709c984c 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs @@ -113,7 +113,7 @@ private static void ConfiureMiddlewares(this WebApplication app) }).WithTags("Test"); //#if (signalr == true) - app.MapHub("/identity-hub"); + app.MapHub("/identity-hub"); //#endif app.MapControllers().RequireAuthorization(); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx index 2d56f236dd..3ea89ee495 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx @@ -235,11 +235,8 @@ - - لاگین جدید - - - دستگاه: {0} + + {0} توکن احراز هویت مرحله دو شما است در Boilerplate. diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fr.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fr.resx index 5ac85305ba..7282eacc82 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fr.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fr.resx @@ -235,11 +235,8 @@ - - Nouvelle session ! - - - Appareil : {0} + + {0} est votre jeton à deux facteurs dans Boilerplate. diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx index c33e8c1c08..67a6d8a7b2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx @@ -235,11 +235,8 @@ - - New session! - - - Device: {0} + + {0} is your two factor token in Boilerplate. From 86d8803bb63003bbae43a596cdc5aaa71bff079b Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sat, 14 Sep 2024 23:29:24 +0200 Subject: [PATCH 3/7] fix --- .../Components/Layout/MainLayout.razor.cs | 6 +++--- .../Boilerplate.Client.Core/Components/SignalRHandler.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs index 3641291d7e..3ddecd0929 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs @@ -22,7 +22,7 @@ protected override async Task OnInitializedAsync() { try { - authManager.AuthenticationStateChanged += IsUserAuthenticated; + authManager.AuthenticationStateChanged += AuthenticationStateChanged; isUserAuthenticated = await prerenderStateService.GetValue(async () => (await AuthenticationStateTask).User.IsAuthenticated()); @@ -64,7 +64,7 @@ private void ToggleMenuHandler() isMenuOpen = !isMenuOpen; } - private async void IsUserAuthenticated(Task task) + private async void AuthenticationStateChanged(Task task) { try { @@ -91,7 +91,7 @@ protected virtual void Dispose(bool disposing) { if (disposed || disposing is false) return; - authManager.AuthenticationStateChanged -= IsUserAuthenticated; + authManager.AuthenticationStateChanged -= AuthenticationStateChanged; unsubscribeCultureChange(); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs index 65f7ed2c56..9dba203dad 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs @@ -14,12 +14,12 @@ protected async override Task OnAfterFirstRenderAsync() { await base.OnAfterFirstRenderAsync(); - authManager.AuthenticationStateChanged += IsUserAuthenticated; + authManager.AuthenticationStateChanged += AuthenticationStateChanged; await ConnectSignalR(); } - private async void IsUserAuthenticated(Task task) + private async void AuthenticationStateChanged(Task task) { try { From d35a96c720625b21aade3a1b8de7092f1406f0a8 Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sat, 14 Sep 2024 23:32:32 +0200 Subject: [PATCH 4/7] fix --- .../Client/Boilerplate.Client.Core/Components/SignalRHandler.cs | 2 +- .../src/Server/Boilerplate.Server.Api/Program.Middlewares.cs | 2 +- .../src/Server/Boilerplate.Server.Web/Program.Middlewares.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs index 9dba203dad..b6d64bbc7e 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs @@ -41,7 +41,7 @@ private async Task ConnectSignalR() var access_token = await AuthTokenProvider.GetAccessTokenAsync(); hubConnection = new HubConnectionBuilder() - .WithUrl($"{Configuration.GetServerAddress()}/identity-hub?access_token={access_token}") + .WithUrl($"{Configuration.GetServerAddress()}/app-hub?access_token={access_token}") .Build(); hubConnection.On("TwoFactorToken", async (token) => diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Middlewares.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Middlewares.cs index 693ba3e1f7..8a8cb45acb 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Middlewares.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Middlewares.cs @@ -65,7 +65,7 @@ public static void ConfiureMiddlewares(this WebApplication app) }).WithTags("Test"); //#if (signalr == true) - app.MapHub("/identity-hub"); + app.MapHub("/app-hub"); //#endif app.MapControllers().RequireAuthorization(); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs index 3a709c984c..bd5ad8d2f0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs @@ -113,7 +113,7 @@ private static void ConfiureMiddlewares(this WebApplication app) }).WithTags("Test"); //#if (signalr == true) - app.MapHub("/identity-hub"); + app.MapHub("/app-hub"); //#endif app.MapControllers().RequireAuthorization(); From d871d20c4133ac004fe1399722d2b7311b842200 Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sun, 15 Sep 2024 00:18:31 +0200 Subject: [PATCH 5/7] fix --- .../.template.config/template.json | 3 +- .../Components/AppInitializer.cs | 155 ++++++++++++++++++ .../Components/AuthenticationStateLogger.cs | 36 ---- .../Components/SignalRHandler.cs | 72 -------- .../Boilerplate.Client.Core/Routes.razor | 5 +- .../Boilerplate.Client.Core/Routes.razor.cs | 67 -------- .../src/Shared/appsettings.json | 6 +- 7 files changed, 160 insertions(+), 184 deletions(-) create mode 100644 src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppInitializer.cs delete mode 100644 src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AuthenticationStateLogger.cs delete mode 100644 src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json b/src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json index b69f6fd967..779dabd726 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json +++ b/src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json @@ -401,8 +401,7 @@ { "condition": "(signalr != true)", "exclude": [ - "src/Server/Boilerplate.Server.Api/Hubs/**", - "src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs" + "src/Server/Boilerplate.Server.Api/Hubs/**" ] }, { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppInitializer.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppInitializer.cs new file mode 100644 index 0000000000..6e329327d4 --- /dev/null +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppInitializer.cs @@ -0,0 +1,155 @@ +//+:cnd:noEmit +using Microsoft.Extensions.Logging; +//#if (signalr == true) +using Microsoft.AspNetCore.SignalR.Client; +//#endif + +namespace Boilerplate.Client.Core.Components; + +public partial class AppInitializer : AppComponentBase +{ + private HubConnection? hubConnection; + + [AutoInject] private MessageBoxService messageBoxService = default!; + [AutoInject] private AuthenticationManager authManager = default!; + [AutoInject] private IJSRuntime jsRuntime = default!; + [AutoInject] private IBitDeviceCoordinator bitDeviceCoordinator = default!; + [AutoInject] private IStorageService storageService = default!; + [AutoInject] private CultureInfoManager cultureInfoManager = default!; + [AutoInject] private ILogger authLogger = default!; + + protected async override Task OnInitAsync() + { + AuthenticationManager.AuthenticationStateChanged += AuthenticationStateChanged; + + AuthenticationStateChanged(AuthenticationManager.GetAuthenticationStateAsync()); + + if (AppPlatform.IsBlazorHybrid) + { + if (CultureInfoManager.MultilingualEnabled) + { + cultureInfoManager.SetCurrentCulture(await storageService.GetItem("Culture") ?? // 1- User settings + CultureInfo.CurrentUICulture.Name); // 2- OS settings + } + + await SetupBodyClasses(); + } + + await base.OnInitAsync(); + } + + protected override async Task OnAfterFirstRenderAsync() + { + await base.OnAfterFirstRenderAsync(); + + if (AppPlatform.IsBlazorHybrid is false) + { + AppPlatform.OSDescription = await jsRuntime.GetBrowserPlatform(); + } + } + + private async void AuthenticationStateChanged(Task task) + { + try + { + var user = (await AuthenticationStateTask).User; + + var (isUserAuthenticated, userId, userName, email, sessionId) = user.IsAuthenticated() ? (user.IsAuthenticated(), user.GetUserId().ToString(), user.GetUserName(), user.GetEmail(), user.GetSessionId()) : default; + + LogAuthenticationState(authLogger, isUserAuthenticated, userId, userName, email, sessionId); + + //#if (signalr == true) + if (InPrerenderSession is false) + { + await ConnectSignalR(); + } + //#endif + } + catch (Exception exp) + { + ExceptionHandler.Handle(exp); + } + } + + [LoggerMessage(Level = LogLevel.Information, Message = "Authentication State: {IsUserAuthenticated}, {UserId}, {UserName}, {Email}, {UserSessionId}")] + private static partial void LogAuthenticationState(ILogger logger, bool isUserAuthenticated, string userId, string userName, string? email, string? userSessionId); + + //#if (signalr == true) + private async Task ConnectSignalR() + { + if (hubConnection is not null) + { + await hubConnection.DisposeAsync(); + } + + var access_token = await AuthTokenProvider.GetAccessTokenAsync(); + + hubConnection = new HubConnectionBuilder() + .WithUrl($"{Configuration.GetServerAddress()}/app-hub?access_token={access_token}") + .Build(); + + hubConnection.On("TwoFactorToken", async (token) => + { + await messageBoxService.Show(Localizer[nameof(AppStrings.TwoFactorTokenPushText), token]); + + // The following code block is not required for Bit.BlazorUI components to perform UI changes. However, it may be necessary in other scenarios. + /*await InvokeAsync(async () => + { + StateHasChanged(); + });*/ + + // You can also leverage IPubSubService to notify other components in the application. + }); + + await hubConnection.StartAsync(CurrentCancellationToken); + } + //#endif + + private async Task SetupBodyClasses() + { + var cssClasses = new List { }; + + if (AppPlatform.IsWindows) + { + cssClasses.Add("bit-windows"); + } + else if (AppPlatform.IsMacOS) + { + cssClasses.Add("bit-macos"); + } + else if (AppPlatform.IsIOS) + { + cssClasses.Add("bit-ios"); + } + else if (AppPlatform.IsAndroid) + { + cssClasses.Add("bit-android"); + } + + var cssVariables = new Dictionary(); + var statusBarHeight = bitDeviceCoordinator.GetStatusBarHeight(); + + if (AppPlatform.IsMacOS is false) + { + //For iOS this is handled in css using safe-area env() variables + //For Android there's an issue with keyboard in fullscreen mode. more info: https://github.com/bitfoundation/bitplatform/issues/5626 + //For Windows there's an issue with TitleBar. more info: https://github.com/bitfoundation/bitplatform/issues/5695 + statusBarHeight = 0; + } + + cssVariables.Add("--bit-status-bar-height", $"{statusBarHeight.ToString("F3", CultureInfo.InvariantCulture)}px"); + await jsRuntime.ApplyBodyElementClasses(cssClasses, cssVariables); + } + + //#if (signalr == true) + protected override async ValueTask DisposeAsync(bool disposing) + { + if (hubConnection is not null) + { + await hubConnection.DisposeAsync(); + } + + await base.DisposeAsync(disposing); + } + //#endif +} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AuthenticationStateLogger.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AuthenticationStateLogger.cs deleted file mode 100644 index e0656fc9c5..0000000000 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AuthenticationStateLogger.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.Extensions.Logging; - -namespace Boilerplate.Client.Core.Components; - -public partial class AuthenticationStateLogger : AppComponentBase -{ - [AutoInject] private ILogger authLogger = default!; - - protected async override Task OnInitAsync() - { - AuthenticationManager.AuthenticationStateChanged += LogAuthenticationState; - - LogAuthenticationState(AuthenticationManager.GetAuthenticationStateAsync()); - - await base.OnInitAsync(); - } - - private async void LogAuthenticationState(Task task) - { - try - { - var user = (await AuthenticationStateTask).User; - - var (isUserAuthenticated, userId, userName, email, sessionId) = user.IsAuthenticated() ? (user.IsAuthenticated(), user.GetUserId().ToString(), user.GetUserName(), user.GetEmail(), user.GetSessionId()) : default; - - LogAuthenticationState(authLogger, isUserAuthenticated, userId, userName, email, sessionId); - } - catch (Exception exp) - { - ExceptionHandler.Handle(exp); - } - } - - [LoggerMessage(Level = LogLevel.Information, Message = "Authentication State: {IsUserAuthenticated}, {UserId}, {UserName}, {Email}, {UserSessionId}")] - private static partial void LogAuthenticationState(ILogger logger, bool isUserAuthenticated, string userId, string userName, string? email, string? userSessionId); -} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs deleted file mode 100644 index b6d64bbc7e..0000000000 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/SignalRHandler.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Boilerplate.Shared.Dtos.Identity; -using Microsoft.AspNetCore.SignalR.Client; - -namespace Boilerplate.Client.Core.Components; - -public partial class SignalRHandler : AppComponentBase -{ - [AutoInject] private MessageBoxService messageBoxService = default!; - [AutoInject] private AuthenticationManager authManager = default!; - - private HubConnection? hubConnection; - - protected async override Task OnAfterFirstRenderAsync() - { - await base.OnAfterFirstRenderAsync(); - - authManager.AuthenticationStateChanged += AuthenticationStateChanged; - - await ConnectSignalR(); - } - - private async void AuthenticationStateChanged(Task task) - { - try - { - await ConnectSignalR(); - } - catch (Exception ex) - { - ExceptionHandler.Handle(ex); - } - } - - private async Task ConnectSignalR() - { - if (hubConnection is not null) - { - await hubConnection.DisposeAsync(); - } - - var access_token = await AuthTokenProvider.GetAccessTokenAsync(); - - hubConnection = new HubConnectionBuilder() - .WithUrl($"{Configuration.GetServerAddress()}/app-hub?access_token={access_token}") - .Build(); - - hubConnection.On("TwoFactorToken", async (token) => - { - await messageBoxService.Show(Localizer[nameof(AppStrings.TwoFactorTokenPushText), token]); - - // The following code block is not required for Bit.BlazorUI components to perform UI changes. However, it may be necessary in other scenarios. - /*await InvokeAsync(async () => - { - StateHasChanged(); - });*/ - - // You can also leverage IPubSubService to notify other components in the application. - }); - - await hubConnection.StartAsync(CurrentCancellationToken); - } - - protected override async ValueTask DisposeAsync(bool disposing) - { - if (hubConnection is not null) - { - await hubConnection.DisposeAsync(); - } - - await base.DisposeAsync(disposing); - } -} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor index fa3869cfe2..8a5f1de3d5 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor @@ -1,9 +1,6 @@ @*+:cnd:noEmit*@ - - @*#if (signalr == true)*@ - - @*#endif*@ + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor.cs index df4497a517..e6cdbad4b5 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor.cs @@ -2,73 +2,6 @@ public partial class Routes { - [AutoInject] IJSRuntime jsRuntime = default!; - [AutoInject] IBitDeviceCoordinator bitDeviceCoordinator = default!; - [AutoInject] IStorageService storageService = default!; - [AutoInject] CultureInfoManager cultureInfoManager = default!; - - protected override async Task OnInitializedAsync() - { - if (AppPlatform.IsBlazorHybrid) - { - if (CultureInfoManager.MultilingualEnabled) - { - cultureInfoManager.SetCurrentCulture(await storageService.GetItem("Culture") ?? // 1- User settings - CultureInfo.CurrentUICulture.Name); // 2- OS settings - } - - await SetupBodyClasses(); - } - - await base.OnInitializedAsync(); - } - - private async Task SetupBodyClasses() - { - var cssClasses = new List { }; - - if (AppPlatform.IsWindows) - { - cssClasses.Add("bit-windows"); - } - else if (AppPlatform.IsMacOS) - { - cssClasses.Add("bit-macos"); - } - else if (AppPlatform.IsIOS) - { - cssClasses.Add("bit-ios"); - } - else if (AppPlatform.IsAndroid) - { - cssClasses.Add("bit-android"); - } - - var cssVariables = new Dictionary(); - var statusBarHeight = bitDeviceCoordinator.GetStatusBarHeight(); - - if (AppPlatform.IsMacOS is false) - { - //For iOS this is handled in css using safe-area env() variables - //For Android there's an issue with keyboard in fullscreen mode. more info: https://github.com/bitfoundation/bitplatform/issues/5626 - //For Windows there's an issue with TitleBar. more info: https://github.com/bitfoundation/bitplatform/issues/5695 - statusBarHeight = 0; - } - - cssVariables.Add("--bit-status-bar-height", $"{statusBarHeight.ToString("F3", CultureInfo.InvariantCulture)}px"); - await jsRuntime.ApplyBodyElementClasses(cssClasses, cssVariables); - } - - protected async override Task OnAfterRenderAsync(bool firstRender) - { - await base.OnAfterRenderAsync(firstRender); - - if (firstRender && AppPlatform.IsBlazorHybrid is false) - { - AppPlatform.OSDescription = await jsRuntime.GetBrowserPlatform(); - } - } - [AutoInject] NavigationManager? navigationManager { set => universalLinksNavigationManager = value; get => universalLinksNavigationManager; } public static NavigationManager? universalLinksNavigationManager; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.json b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.json index 4862199055..79f45d7e26 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.json +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.json @@ -2,14 +2,14 @@ "Logging": { "LogLevel": { "Default": "Warning", - "Boilerplate.Client.Core.Components.AuthenticationStateLogger": "Information", + "Boilerplate.Client.Core.Services.AuthenticationManager": "Information", "Microsoft.EntityFrameworkCore.Database.Command": "Information" }, //#if (appCenter == true) "AppCenterLoggerProvider": { "LogLevel": { "Default": "Warning", - "Boilerplate.Client.Core.Components.AuthenticationStateLogger": "Information", + "Boilerplate.Client.Core.Services.AuthenticationManager": "Information", "Microsoft.EntityFrameworkCore.Database.Command": "Information" } }, @@ -18,7 +18,7 @@ "ApplicationInsights": { "LogLevel": { "Default": "Warning", - "Boilerplate.Client.Core.Components.AuthenticationStateLogger": "Information", + "Boilerplate.Client.Core.Services.AuthenticationManager": "Information", "Microsoft.EntityFrameworkCore.Database.Command": "Information" } } From e4bf0f3eeaee0e7ba1a0f45d308cb1b8c731ba95 Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sun, 15 Sep 2024 00:25:42 +0200 Subject: [PATCH 6/7] fix --- .../src/Client/Boilerplate.Client.Core/Routes.razor | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor index 8a5f1de3d5..03ef42a6f1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Routes.razor @@ -1,5 +1,4 @@ -@*+:cnd:noEmit*@ - + Date: Sun, 15 Sep 2024 00:31:55 +0200 Subject: [PATCH 7/7] fix --- .../Client/Boilerplate.Client.Core/Components/AppInitializer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppInitializer.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppInitializer.cs index 6e329327d4..12b91b9ac0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppInitializer.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppInitializer.cs @@ -8,7 +8,9 @@ namespace Boilerplate.Client.Core.Components; public partial class AppInitializer : AppComponentBase { + //#if (signalr == true) private HubConnection? hubConnection; + //#endif [AutoInject] private MessageBoxService messageBoxService = default!; [AutoInject] private AuthenticationManager authManager = default!;