berjmapper 1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package berjmapper --version 1.0.1
NuGet\Install-Package berjmapper -Version 1.0.1
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="berjmapper" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add berjmapper --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: berjmapper, 1.0.1"
#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.
// Install berjmapper as a Cake Addin #addin nuget:?package=berjmapper&version=1.0.1 // Install berjmapper as a Cake Tool #tool nuget:?package=berjmapper&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Feature
The BerjMapper class provides a user-friendly interface to manage conversions between two different data types and helps to avoid duplicate work in the code.
Errors are corrected as a result of feedback.
berjmapper
Version
.net 7.0
Install
dotnet add package
Information
var product = new Product
{
Id = 1,
Name = "berjCode",
Description = "offers pride"
};
var productDto = BerjMapper<Product, ProductDto>.Convert(product);
first parameter should be source, second should be destination. In Convert, it must be the converted type.
here product is converted to productdto.
# Use Converting Product to ProductDto
var Product = new Product
{
Id = 1,
Name = "berjCode",
Description = "offers pride"
};
Console.WriteLine("----------- Converting Product to ProductDto ------------");
var productDto = BerjMapper<Product, ProductDto>.Convert(Product);
Console.WriteLine(productDto.Id);
Console.WriteLine(productDto.Name);
## ProductListDto
Console.WriteLine("----------- ProductListDto ------------");
var products = new List<Product>()
{
new Product { Id = 1, Name = "Product 1" },
new Product { Id = 2, Name = "Product 2" },
new Product { Id = 3, Name = "Product 3" },
};
var productListTest = BerjMapper<Product, ProductListDto>.ConvertList(products);
foreach (var productListDto in productListTest)
{
Console.WriteLine(productListDto.Id);
Console.WriteLine(productListDto.Name);
}
Console.WriteLine(productListDto.Name);
....
## Converting CreateProductDto To Product
Console.WriteLine("----------- CreateProductDto To Product ------------");
var createProductDtoTest = BerjMapper<ProductCreateDto, Product>.Convert(productCreateDto);
Console.WriteLine("Product ID: " + createProductTest.Id);
Console.WriteLine("Product Name: " + createProductTest.Name);
## Warning
* No package is needed. Not recommended for large projects. Recommended for education and small projects.
* It can give errors in complex objects.
### By Abdullah Balikci - berjcode
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added check for null values. performance improvements were made.