Zonit.Extensions.Website.MudBlazor
0.2.7
dotnet add package Zonit.Extensions.Website.MudBlazor --version 0.2.7
NuGet\Install-Package Zonit.Extensions.Website.MudBlazor -Version 0.2.7
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zonit.Extensions.Website.MudBlazor" Version="0.2.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zonit.Extensions.Website.MudBlazor" Version="0.2.7" />
<PackageReference Include="Zonit.Extensions.Website.MudBlazor" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zonit.Extensions.Website.MudBlazor --version 0.2.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Zonit.Extensions.Website.MudBlazor, 0.2.7"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zonit.Extensions.Website.MudBlazor@0.2.7
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zonit.Extensions.Website.MudBlazor&version=0.2.7
#tool nuget:?package=Zonit.Extensions.Website.MudBlazor&version=0.2.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Zonit.Extensions
Useful tools for Blazor
Abstractions Package
Zonit.Extensions.Abstractions - Interfaces and base abstractions
dotnet add package Zonit.Extensions.Abstractions
Zonit.Extensions - Core utilities and extensions
dotnet add package Zonit.Extensions
What's included:
- Exceptions - Structured exception handling with i18n support, error codes, and strongly-typed error parameters
- Reflection - Utility class for discovering assemblies and types that implement or inherit from a specified base type
- Xml - Utility class for serializing objects to XML and deserializing XML back to objects
- ValueObjects - Immutable value objects for common domain concepts (Price, Title, Description, UrlSlug, Culture)
Blazor Website Extensions
Zonit.Extensions.Website.Abstractions - Interfaces and abstractions for Blazor
dotnet add package Zonit.Extensions.Website.Abstractions
Zonit.Extensions.Website - Blazor-specific components and utilities
dotnet add package Zonit.Extensions.Website
What's included:
- Components - Reusable Blazor components
- Cookie handling with Blazor support (see below)
MudBlazor Integration
Zonit.Extensions.Website.MudBlazor - MudBlazor converters for Value Objects
dotnet add package Zonit.Extensions.Website.MudBlazor
What's included:
ZonitTextField<T>- MudTextField with automatic Value Object converterZonitTextArea<T>- Multiline version for longer content- Built-in exception handling with automatic error messages
- AOT and Trimming compatible (type inference at compile time)
Supported Value Objects: Title, Description, UrlSlug, Content, Url, Culture
Usage (type is inferred from @bind-Value):
@using Zonit.Extensions.MudBlazor
<ZonitTextField @bind-Value="Model.Title" Label="Title" />
<ZonitTextField @bind-Value="Model.Description" Label="Description" />
<ZonitTextField @bind-Value="Model.Slug" Label="URL Slug" />
@* For multiline content *@
<ZonitTextArea @bind-Value="Model.Content" Label="Content" />
No need to specify T="Title" - the compiler infers the type automatically!
Cookie handling with support for Blazor
Installation:
Add this in Routes.razor
@using Zonit.Extensions
<ZonitCookiesExtension />
Services in Program.cs
builder.Services.AddCookiesExtension();
App in Program.cs
app.UseCookiesExtension();
Example:
@page "/"
@rendermode InteractiveServer
@using Zonit.Extensions.Website
@inject ICookieProvider Cookie
@foreach (var cookie in Cookie.GetCookies())
{
<p>@cookie.Name @cookie.Value</p>
}
API
public CookieModel? Get(string key);
public CookieModel Set(string key, string value, int days = 12 * 30);
public CookieModel Set(CookieModel model);
public Task<CookieModel> SetAsync(string key, string value, int days = 12 * 30);
public Task<CookieModel> SetAsync(CookieModel model);
public List<CookieModel> GetCookies();
We use SetAsync only in the Blazor circuit. It executes the JS code with the Cookies record.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- MudBlazor (>= 9.0.0-preview.2)
- Zonit.Extensions (>= 0.2.7)
-
net8.0
- MudBlazor (>= 9.0.0-preview.2)
- Zonit.Extensions (>= 0.2.7)
-
net9.0
- MudBlazor (>= 9.0.0-preview.2)
- Zonit.Extensions (>= 0.2.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.