Questions tagged [automapper-12]

10 questions
2
votes
1 answer

AutoMapper Multi-level Child Inheritance not working anymore in 12.0.1 after upgrading from 12.0.0

It's best to demonstrate this issue with a fiddle. The following fiddle is using AutoMapper 12.0.1 and will fail the test. https://dotnetfiddle.net/Qtvc1Z The following is the same codes but using AutoMapper 12.0.0 which works judging from the…
Twisted Whisper
  • 1,166
  • 2
  • 15
  • 27
1
vote
1 answer

ignore child object's property automapper c#

I am trying to update some data with some input by HttpPut which has an list of object. But specially I want to update child object's some properties. Inputs public class WarehouseInput { public string WarehouseCode { get; set; } public string…
Berker
  • 11
  • 3
1
vote
0 answers

EF Core Power Tools: Missing setter for collections

Is there a way to have the EF Core Power Tools create setters for collections, like so: class Parent { // ... public virtual ICollection Children { get; } // Setter is missing } The setter would be extremely useful with…
1
vote
1 answer

Migration from .Net 6.0 To .Net 7 Automapper issues

Migration from .Net 6.0 To .Net 7 Automapper having issues in Startup.cs Severity Code Description Project File Line Suppression State Error CS1503 Argument 1: cannot convert from 'System.Reflection.Assembly' to …
User
  • 1,334
  • 5
  • 29
  • 61
0
votes
0 answers

Ignore Attribute with AutoMap Reverse Attribute not working

I have a property that is Ignored with Ignore Attribute in a DTO with AutoMap Reverse. When I try to get from DTO to entity, seem like the ignored attribute is being copied to destiny Entity, wouldn´t it be left on copy when source (dto) has the…
0
votes
1 answer

Use ResolutionContext in tests for Automapper

How do I test an Automapper ITypeConverter Converter with a ResolutionContext? I have a complicated converter and want to test it explicitly. It needs an argument ResolutionContext which I cannot get to, nor create nor mock. Is it possible? public…
LosManos
  • 7,195
  • 6
  • 56
  • 107
0
votes
0 answers

AutoMapper AllowAdditiveTypeMapCreation doesn't merge mappings

When using Internal().AllowAdditiveTypeMapCreation = true;, I was expecting that CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() .ForMember(dest => dest.Name, opt =>…
Twisted Whisper
  • 1,166
  • 2
  • 15
  • 27
0
votes
1 answer

Automapper 12 not ignoring related entities

I'm using Automapper 12 to map a model over an existing EF entity. Ignores are respected on the main entity being updated, but not on the related entities and I'm not quite sure why (lacking proper collections support?) var model = new User() { …
Michael Brown
  • 1,585
  • 1
  • 22
  • 36
0
votes
1 answer

Fill with new data along with remain existing data map with Automapper

I am implementing update user endpoint. During update, I am fetching original entity. public class UserEntity { public Guid Id { get; set; } public Dictionary> Attributes { get; set; } } var user = await…
hoozr
  • 403
  • 4
  • 15
0
votes
1 answer

How to map destination properties with destination class name as prefix using AutoMapper 12.0

TL;DR: Is there a way to create a sort of convention or prefix rule that would use the source or destination class names as prefix for some field mappings using AutoMapper 12.0? I'm experimenting with AutoMapper 12.0 in a dotnet core 6 project and…
Ricardo Souza
  • 16,030
  • 6
  • 37
  • 69