MY.QuickAPI.Shared
1.0.0
dotnet add package MY.QuickAPI.Shared --version 1.0.0
NuGet\Install-Package MY.QuickAPI.Shared -Version 1.0.0
<PackageReference Include="MY.QuickAPI.Shared" Version="1.0.0" />
<PackageVersion Include="MY.QuickAPI.Shared" Version="1.0.0" />
<PackageReference Include="MY.QuickAPI.Shared" />
paket add MY.QuickAPI.Shared --version 1.0.0
#r "nuget: MY.QuickAPI.Shared, 1.0.0"
#:package MY.QuickAPI.Shared@1.0.0
#addin nuget:?package=MY.QuickAPI.Shared&version=1.0.0
#tool nuget:?package=MY.QuickAPI.Shared&version=1.0.0
MY.uickAPI.Shared
Overview
MY.QuickAPI.Shared
is a shared library package designed to be used across both backend and frontend applications. It provides a common set of Data Transfer Object (DTO) models to ensure consistency between different parts of the application.
This package simplifies data handling by allowing both backend and frontend to use the same DTO models, reducing duplication and minimizing inconsistencies.
Features
- Common DTOs: Defines shared data models that can be used in both backend and frontend.
- JSON Serialization: Uses
System.Text.Json
for efficient serialization and deserialization. - Lightweight and Reusable: Can be referenced in multiple projects without unnecessary dependencies.
Installation
Backend (C#)
If you're using the MY.QuickAPI
package in your backend project, you don’t need to reference this package separately, as it is already included.
However, if you want to add it manually, install it via NuGet:
dotnet add package QuickAPI.Shared
Frontend (Blazor or .NET-based)
If your frontend is built with Blazor or any other .NET-based technology, you can reference this package as follows:
dotnet add package QuickAPI.Shared
If your frontend is not using C#, this package can be ignored.
Usage
BaseDto
The BaseDto
class serves as the base record for DTO objects. It includes:
- Id (
Guid
) - Unique identifier. - Name (
string
) - Entity name. - Description (
string
) - Additional details. - ToString() Override - Returns the JSON representation of the DTO.
using QuickAPI.Shared.Dtos;
public record ProductDto : BaseDto
{
public decimal Price { get; init; }
}
JSON Serialization Example
var product = new ProductDto
{
Id = Guid.NewGuid(),
Name = "Laptop",
Description = "High-performance laptop",
Price = 1500.99M
};
string json = product.ToString();
Console.WriteLine(json);
Example Output
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Laptop",
"description": "High-performance laptop",
"price": 1500.99
}
Notes
- This package should not be included in the backend project if
QuickAPI
is already referenced. - This package can be ignored if the frontend is not written in C#.
License
This project is licensed under the Apache 2.0 License.
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 was computed. 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 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MY.QuickAPI.Shared:
Package | Downloads |
---|---|
MY.QuickAPI
A .NET library for building APIs quickly with CRUD endpoints, DTO support, and more |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 320 | 3/4/2025 |