Mapster
Mapster copied to clipboard
A fast, fun and stimulating object to object Mapper
for now I can have something like the following to register mapping for all enums in the system ``` config.NewConfig() .MapWith(s => new KeyValueData(s, Enums.ResourceManager)); ``` However, it's not possible...
Hi, I use [Mapster](https://github.com/MapsterMapper/Mapster) with version 7.3.0 and .Net 7.0.1 I have two classes. ```csharp public class Entity { public Guid Id { get; set; } public string Content {...
In this code you see ``` TypeAdapterConfig.NewConfig() .Include() .Include() .Include() .Include() .Include(); var resault1 = dbContext.Requests.First().Adapt(); var resault2 = dbContext.Requests.ToList().Map(); ``` resault1 is an instance of RequestBaseDto resault2 is an...
``` var v_int1 = 1; var v1_= v_int1.Adapt();//error :“Invalid cast from 'System.Int32' to ... var v1_2 = v_int1.Adapt().Adapt();//ok ```
In the following example, the IgnoreNullValues loses its role. Although Person Name is a null, it still calls the trim method as defined in the map function, Leading in abnormal...
Let's say I have a situation where an incoming collections needs to be mapped onto an existing collection. `src.Adapt(dest)` doesn't produce the intended outcome since (I assume) Mapster doesn't know...
I am using code generation using mapster tool, but looks like this is not supported, Can someone help ``` //for every string property you find in the source object, use...
From [this SO question](https://stackoverflow.com/questions/75874897). Given the type `Id`: ```csharp public class Id { private readonly Guid _guid; public Id(Guid id) => _guid = id; public static implicit operator Id(Guid value)...
Given the following configuration:  CompanyMapsterModule belongs to ErgoBackend.Managers.Companies:  I don't want to explicitly keep declaring mapster modules using apply, so I use the Scan method. But if I...
Hi! Am I right that failing assert in this test means bug? In version 6.5.1 it works fine. ``` using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; namespace Mapster.Tests { [TestClass] public class WhenMappingStructInObject...