Object Mapping with Mapster in C# .NET 8

preview_player
Показать описание
Mapping data from one object to another is a common practice in C# .NET. I used to use AutoMapper until I met Mapster. What is your preferred way of mapping object data?

If you found this video helpful, like & subscribe! That means a lot to me!

00:00 Intro
00:27 Why I use a Mapper
01:30 Manual Mapping
02:50 When I use a Mapper
05:30 Using Mapster
06:17 Using AutoMapper
08:55 Outro

#mapster #automapper #dotnet8 #csharp #dotnet #webapi #serilog #logging #monitoring #api #webdevelopment #fullstack #fullstacksoftwareengineering #backend #docker #azure #containerization #devops #cloud #microsoft #entityframework #identityframework #mssqlserver #mssql #cleanarchitecture #authentication #api #development #local #web #authorization #jwt #bearer #cqrs #mediatr #webapi #cors #http #stateless #webscraping #workers #migration #modular #monolith #verticalslicearchitecture #minimalapi #ratelimit #origin #host
Рекомендации по теме
Комментарии
Автор

@07:24 The Mapster alternative of '.ForMember' is:

TypeAdapterConfig<Address, AddressResponse>
.NewConfig()
.Map(response => response.Location, entity => entity.Location.AsText())
.Map(response => response.Viewport, entity => entity.Viewport.AsText());

I'll place this in my "ConfigureServices.cs" or "Extensions.cs".

Also, using the IMapper to migrate from AutoMapper to Mapster can save you some time.

kis.stupid