Tolitech.CodeGenerator.Notification
1.0.0-alpha-3
See the version list below for details.
dotnet add package Tolitech.CodeGenerator.Notification --version 1.0.0-alpha-3
NuGet\Install-Package Tolitech.CodeGenerator.Notification -Version 1.0.0-alpha-3
<PackageReference Include="Tolitech.CodeGenerator.Notification" Version="1.0.0-alpha-3" />
paket add Tolitech.CodeGenerator.Notification --version 1.0.0-alpha-3
#r "nuget: Tolitech.CodeGenerator.Notification, 1.0.0-alpha-3"
// Install Tolitech.CodeGenerator.Notification as a Cake Addin #addin nuget:?package=Tolitech.CodeGenerator.Notification&version=1.0.0-alpha-3&prerelease // Install Tolitech.CodeGenerator.Notification as a Cake Tool #tool nuget:?package=Tolitech.CodeGenerator.Notification&version=1.0.0-alpha-3&prerelease
Tolitech.CodeGenerator.Notification
Notifications library used in projects created by the Code Generator tool.
This project allows to simplify the communication and message return between the domain and the presentation layer, allowing that validation errors, business or messages of any other nature can be recovered and used as needed.
In other words, we expose an object that collects together information about errors and other information in the domain layer and communicates it to the presentation.
Tolitech Code Generator Tool: http://www.tolitech.com.br
Examples:
public abstract class Entity : Notifiable
{
public void Validate(ValidationResult result)
{
NotificationResult.Clear();
foreach (var error in result.Errors)
{
NotificationResult.AddError(error.ErrorMessage);
}
}
}
public class Person : Entity
{
public Person(string name)
{
Name = name;
}
public string Name { get; set; }
public override void Validate()
{
var validator = new TestValidator();
Validate(validator.Validate(this));
}
}
public class PersonValidator : AbstractValidator<Person>
{
public PersonValidator()
{
RuleFor(x => x.Name)
.NotEmpty()
.MaximumLength(10);
}
}
var person = new Person(name: "Name");
bool isValid = person.IsValid();
var result = new NotificationResult();
result.AddMessage("message");
var result = new NotificationResult();
result.AddError(new Exception("exception"));
var ex = result.GetException();
var result = new NotificationResult();
result.AddMessage("message1");
result.AddMessage("message2");
result.AddMessageOnTop("message3");
bool isValid = result.IsValid;
var result = new NotificationResult();
result.AddError("message");
bool isValid = result.IsValid;
In unit tests, it is possible to know the dozens of variations and possibilities that exist between notifications of error, success, warning and the traffic of other objects and relevant information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Tolitech.CodeGenerator.Notification:
Package | Downloads |
---|---|
Tolitech.CodeGenerator.AspNetCore
AspNetCore library for Tolitech Code Generator. |
|
Tolitech.CodeGenerator.Auditing.Trail
Auditing trail library for Tolitech Code Generator. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-alpha-4 | 98 | 4/6/2023 |
1.0.0-alpha-3 | 87 | 4/6/2023 |
1.0.0-alpha-2 | 126 | 2/18/2022 |
1.0.0-alpha-1 | 548 | 11/18/2021 |
More information at http://www.tolitech.com.br/