The structure of the project looks so that for each entity a separate folder is allocated, which stores the mapper interface, but the generation occurs in the directory above. I need to make the mapper class be generated in the same directory as the…
I am using mapster to map between entities and DTOs. I have noticed it will not map a Guid? to a Guid (or vice-versa) even if I add it explicitely to a mapping register like such :
public sealed class HostConversionMappingRegister : IRegister
{
…
I'm having difficulties getting all members mapped in the following scenario:
I have a class that inherits from List:
public class PagedList : List
{
public int CurrentPage { get; private set; }
public int TotalPages { get; private…
I come here because i dont find the answer online :/
I would like to test my configuration of Mapster to avoid miss mapping which happens at developpement time. But i dont find how to implement that with Mapster lib.
Any clue ?
Regards,
I'm trying to map from one hierarchy to another. Both my parent classes are abstracts as I'd never need to instantiate them, only their children. I would like to use a single mapping config the constructor of each child rather than create mapping…
Using mapster and have the following problem
https://github.com/MapsterMapper/Mapster
I have to class and a dto class.
public class Client {
public string Requirements { get; set; }
}
public class ClientDto {
public bool RequirePkce { get;…
How I can use MapContext.Current in nested mappings? For example:
public class Foo {
public string Name { get; set; }
}
public class Bar {
public string Name { get; set; }
}
public class Src {
public IEnumerable Foos { get; set; }…
I would like to have a default mapping used always and then I would like to be able to override it when required.
Here is the modified example code
public SchoolController(IMapper mapper, SchoolContext context)
{
_mapper = mapper;
…
As per Mapster documentation https://github.com/MapsterMapper/Mapster/wiki/Dependency-Injection
I am supposed to do the following:
public void ConfigureServices(IServiceCollection services)
{
...
var config = new TypeAdapterConfig();
…
I have 3 classes with the name of Employee, EmployeeTwo, and EmployeeThree, I wanted to map Employee to EmployeeTwo and Employee to EmployeeThree.
Following are the Classes.
I also have tried to define the AdaptMember attribute on the Employee Class…
I am trying to map a service model to a view model using Mapster.
My service model contains a list of strings.
My View Model contains a list of type RolesViewModel.
RolesViewModel has a string property named RoleName.
Below are my models
public…
I am using Mapster mapper and EF Core, and I have a Request entity that has many Materials.
I am fetching the graph from the database as a tracked graph and using Mapster I map dto to the EF object graph as follows:
dto.Adapt(requestGraph);
It…
I am using Mapster for mapping my objects.
I have the the following code:
public sealed class User : AggregateRoot
{
public string FirstName { get; }
public string LastName { get; }
public string Email { get; }
public string…
I use mapster and its code generation. I have models like this:
public class Device
{
public Guid Id { get; set; }
public User User { get; set; }
}
public class User
{
public Guid Id { get; set; }
}
And the same models for Dto…