I'm not yet dependent to either Mapster or AutoMapper. For now I'm using handwritten mappings because I couldn't find a mapper who could do this with smaller code.
The problem is how do we map flatten structures to complex objects? I think a lot of…
The documentation on the Mapster Wiki isnt very good and I cant seem to get it hooked up with Simple Injector.
I have this below:
container.RegisterSingleton(() =>
MapperProvider.GetConfiguredMappingConfig());
container.Register
I have a business need to dynamically select ONLY the properties of a given model that are specified, similar to an OData select clause. I am currently using Mapster's ProjectToType functionality to populate view models from EF Core entities.
Is…
I have a Visual Studio solution containing various sample console app projects. One of which is MapsterSample where I am trying out Mapster and following the steps described on GitHub https://github.com/MapsterMapper/Mapster/wiki/Mapster.Tool to…
I'm doing a wrapper for an API and I have my json models which I would map into my entity models with MapsterMapper.
I have tried to simply do jsonModel.Adapt() with EntityModel looking like this:
public class EntityModel {
public int…
So I have "entities" and "dtos".
Department has N Employees
Employee has 1 (parent) Department.
Right now I have no deviation with property names.
My EFCore "query" is getting All Departments with an Include (child) Employees.
I prefer to isolate my…
Mapster.Tool fails to generate any code.
The problem seems to be a class derived from CosmosClient - which i get from a nuget package.
I get this exception:
Cannot find library: Microsoft.Azure.Cosmos.Client
Unhandled exception.…
I'm try to learn Mapster. I have classes like this
class In
{
public string A;
public string B;
public string C;
}
class Out
{
public Sub Sub;
public string C;
}
class Sub
{
public string A;
public string B;
…
I have an object representing an update:
var update = new ExpandoObject();
update.AddSafely("Name", "Mary");
This property is part of a dto, like:
public class Dto
{
public string Name {get; set;}
public string Other {get; set;
}
var data =…
Classes:
public class Department
{
public string Name { get; set; }
}
public class DepartmentA : Department
{
public string NameA { get; set; }
}
public class Employee
{
public string Name { get; set; }
public int Salary { get;…
When I try to compile the mapster configuration, it throws an AmbiguousMatchException in this specific mapping:
config.NewConfig()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.Prop1, src => src.Prop1)
…
I'm using Mapster 5.3.1 with DI in EF Core 3.1 ... and I have a question.. is there a way to ignore all null values in source member during mapping when both members are IEnumerable and both have identical structure.
var tSource = (IEnumerable)
var…
I'm using Mapster to map values from a dto based on a json object to a Entity Framework data table.
The destination class has a field
[Column(TypeName = "datetime2(3)")]
public DateTime? CorrectBy { get; set; } that is being filled from a…
Using Mapster with the Mapster DI package I also have a static class called MapperConfig that has a static method that does all my dto to viewmodel mapping.
public static class MapperConfig
{
public static void Config()
{
var tenantId =…