Empezar.BlazorWebClient
1.9.3-alpha
dotnet add package Empezar.BlazorWebClient --version 1.9.3-alpha
NuGet\Install-Package Empezar.BlazorWebClient -Version 1.9.3-alpha
<PackageReference Include="Empezar.BlazorWebClient" Version="1.9.3-alpha" />
paket add Empezar.BlazorWebClient --version 1.9.3-alpha
#r "nuget: Empezar.BlazorWebClient, 1.9.3-alpha"
// Install Empezar.BlazorWebClient as a Cake Addin #addin nuget:?package=Empezar.BlazorWebClient&version=1.9.3-alpha&prerelease // Install Empezar.BlazorWebClient as a Cake Tool #tool nuget:?package=Empezar.BlazorWebClient&version=1.9.3-alpha&prerelease
Empezar.BlazorWebClient
Ease development and maintenance of a blazor web app server project, serving WASM as well as prerendering razor components.
Aim is to consolidate all the common services that all API projects serving WASM or MAUI applications need in secure and robust manner.
Please note, this is a Client only package for Empezar.BlazorWebAPI
Installation
Install the nuget package for Empezar.BlazorWebClient in your API Project.
You can also use Manager Nuget Packages
to install the same.
dotnet add package Empezar.BlazorWebClient
Usage
Register the service in Program.cs of API project.
Please note that this service already encapsulates Empezar.Cloud
service. Hence, if using this package, you do not need to register Empezar.Cloud
service.
services.AddEZRBlazorWebClient(APIBaseAddress, appPlatform);
Tools for Development
IQurl
Manage httpClient calls easily
var response = await qurl.OnPath(Url.Path(BaseAPI.AppSettings).Query("platform", BaseConstants.CurrentPlatform.ToString()), HttpMethod.Get, logger)
.ReadAsStringAsync(CancellationToken.None);
ICrypt
Inject ICrypt for Encryption and Decryption accross all platforms. Encrypt / Decrypt model or string cross platform.
async Task<IResult> (AppPlatform platform, IConfiguration config, ICrypt crypt) =>
{
string? microsoftCallbackURLSection = null, googleClientId = null, googleClientSecret = null, googleCallbackURL = null;
switch (platform)
{
case AppPlatform.Windows:
microsoftCallbackURLSection = "EZRBlazorWebAPI:Authentications:Microsoft:CallbackPath_Win";
googleClientId = endpoints.Configuration[BaseConfigConstants.GGWinClientId];
googleClientSecret = endpoints.Configuration[BaseConfigConstants.GGWinClientSecret];
googleCallbackURL = endpoints.Configuration[BaseConfigConstants.GGWinCallbackPath];
break;
case AppPlatform.Android:
microsoftCallbackURLSection = "EZRBlazorWebAPI:Authentications:Microsoft:CallbackPath_Android";
googleClientId = endpoints.Configuration[BaseConfigConstants.GGAndClientId];
googleClientSecret = endpoints.Configuration[BaseConfigConstants.GGAndClientSecret];
googleCallbackURL = endpoints.Configuration[BaseConfigConstants.GGAndCallbackPath];
break;
case AppPlatform.IOS or AppPlatform.MacCatalyst:
microsoftCallbackURLSection = "EZRBlazorWebAPI:Authentications:Microsoft:CallbackPath_Mac";
googleClientId = endpoints.Configuration[BaseConfigConstants.GGMacClientId];
googleClientSecret = endpoints.Configuration[BaseConfigConstants.GGMacClientSecret];
googleCallbackURL = endpoints.Configuration[BaseConfigConstants.GGMacCallbackPath];
break;
case AppPlatform.WASM:
microsoftCallbackURLSection = "EZRBlazorWebAPI:Authentications:Microsoft:CallbackPath";
googleClientId = string.Empty;
googleClientSecret = string.Empty;
googleCallbackURL = string.Empty;
break;
default:
throw new Exception($"Invalid Platform {platform}");
}
string? environment = null;
return Results.Text(await crypt.EncryptAsync(new AppConfig(
Environment: string.IsNullOrEmpty(environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")) ? "Production" : environment,
Microsoft:
new(Authority: $"{endpoints.Configuration["EZRBlazorWebAPI:Authentications:Microsoft:Instance"]!}{endpoints.Configuration["EZRBlazorWebAPI:Authentications:Microsoft:TenantId"]!}/v2.0",
ClientId: endpoints.Configuration["EZRBlazorWebAPI:Authentications:Microsoft:ClientId"]!,
CallbackURL: endpoints.Configuration[microsoftCallbackURLSection]!),
Google:
new(ClientId: googleClientId!,
ClientSecret: googleClientSecret!,
CallbackURL: googleCallbackURL!),
AgGridLicenseKey: endpoints.Configuration["EZRBlazorWebAPI:AgGridLicenseKey"]
), BaseConstants.AppConfigEncryptionKey));
}
IMini
Compress / Decompress bytes, strings, files
//Compress
await iMini.CompressAsync(byteArray);
//Decompress
await iMini.DecompressAsync(byteArray);
Import / Export
Import and Export excel files or razor components as PDF's or extract HTML to send as email
AsyncChron
Chron job in MAUI and WASM
BaseAppCache
Lazy Caching services on client side
Fily
File service for WASM and MAUI
Port of Handson Table and AG-Grid
Use components <HandsonTable />
or <AGGrid />
Base class for Razor components
Takes case of general activities like creation and disposal along with managing PersistingComponentStateSubscription for sharing prerender data
IEZRAuthenticationService
Provides methods for Authentication which works cross platforms
URL class
manages creating URL with encoding of url query parameters with easy. Implicit conversion to Uri supported. For string, use .ToString();
Please explore for many more such features that can't be documented
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net9.0
- Blazor-ApexCharts (>= 5.1.0)
- ClosedXML (>= 0.104.2)
- FluentValidation (>= 11.11.0)
- itext7.bouncy-castle-adapter (>= 9.1.0)
- itext7.pdfhtml (>= 6.1.0)
- Microsoft.AspNetCore.Components.WebAssembly.Authentication (>= 9.0.2)
- Microsoft.Extensions.Http (>= 9.0.2)
- Microsoft.Identity.Client (>= 4.68.0)
- MudBlazor (>= 8.2.0)
- Radzen.Blazor (>= 6.0.19)
- System.IdentityModel.Tokens.Jwt (>= 8.5.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Empezar.BlazorWebClient:
Package | Downloads |
---|---|
Empezar.BlazorWebAPI
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.9.3-alpha | 0 | 2/21/2025 |
1.9.2-alpha | 46 | 2/14/2025 |
1.9.1-alpha | 41 | 2/14/2025 |
1.9.0-alpha | 43 | 2/14/2025 |