Questions tagged [automapper-11]
17 questions
12
votes
1 answer
System.DateTime on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type T for .NET 7 using AutoMapper 11.0.1
Complete source;
// See https://aka.ms/new-console-template for more information
using AutoMapper;
Console.WriteLine("Hello, World!");
var mapperConfig = new MapperConfiguration(mc =>
{
mc.AddProfile(new…

Ogglas
- 62,132
- 37
- 328
- 418
2
votes
0 answers
Map or Ignore Indexer Property in Automapper 11
I'm having some issues mapping two classes using the AutoMapper in version 11. The destination class has an indexer-property, which causes the issue.
Since Automapper 11, the indexer property is no longer automatically ignored.
For testing purposes…

SJP
- 1,000
- 1
- 10
- 19
1
vote
4 answers
In .Net Core 6 Api, how to map only the values that exist in the DTO uisng AutoMapper 11?
while writing an Api wtih .NET Core 6(This is my first Api), I'm having some trouble while writing an Update method. I need to update my Application table below
public partial class Application
{
public Guid Id { get; set; }
…

Mertcan Gültekin
- 21
- 2
1
vote
1 answer
How to fix: Automapper 11 with conflict dependency
After upgrade of Autommaper from 10 to the latest v.11 and Automapper.Collection to the latest v.7 it appears there is a conflict.
Is it by design? Should I worry that it might cause problems in future? How to fix it?

1gn1ter
- 1,414
- 2
- 22
- 47
1
vote
2 answers
FindTypeMapFor method not exists in AutoMapper 11
I am currently upgrading a web API that was developed on NET Core 5.0 and upgrading it to NET Core 6.0. When upgrading the NuGet AutoMapper package to version 11.0.1, I find that the FindTypeMapFor method does not exist in the ConfigurationProvider…
0
votes
0 answers
Force a property to be mapped first with AutoMapper 11+
I have a couple of objects in a project which is currently using AutoMapper 10 where the I need one particular property to be mapped before all the others. In AM10 this was easy by setting the target properties mapping order to some low value, then…

James Hobson
- 193
- 2
- 8
0
votes
0 answers
AutoMapper ProjectTo on object fields with the same name but different types
I am projecting the result of an entity framework database call into a new object type.
await _db.Type1
.ProjectTo(_mapper.ConfigurationProvider)
.ToListAsync(cancellationToken);
The Type2 object has the following field on it where the type…

TCR
- 45
- 1
- 4
0
votes
1 answer
Use AutoMapper inside a class library project in ASP.NET Core Web API
I'm getting this error:
AutoMapper.AutoMapperMappingException: 'Missing type map configuration or unsupported mapping.'
in my project when trying to map an EF model to my DTO.
Profiles and value resolvers are in my class library project.
This is…

Ali.Rashidi
- 1,284
- 4
- 22
- 51
0
votes
1 answer
Automapper's ProjectTo not playing nice with generics
Using ProjectTo with automapper and generics doesn't seem to work well. I created this mapping:
CreateMap()
.AfterMap((entity, dto) => {
dto.ETag = "something here";
dto.Compiler = new() {
…

Gargoyle
- 9,590
- 16
- 80
- 145
0
votes
1 answer
ProjectTo with ITypeConverter
I am using Automapper for mapping DB entities from entity framework to business objects through ProjectTo<>(). Now I'd like to map/project nullable decimal to class type and don't want to specify manual mapping of these two types for every property…

Peter Grodin
- 9
- 3
0
votes
1 answer
AutoMapper ProjectTo from a model with child list entity
Is this possible in AutoMapper?
Select list of type X and filter child entity of type Y (return single value of Y)
ProjectTo to a flat DTO contains props from X and Y.
If it is not, then what is the best way to populate the DTO in this scenario,…

User1660303
- 5
- 2
0
votes
2 answers
AutoMapper 11. Missing API replacements
28.2 ForAllMaps, ForAllPropertyMaps, Advanced and other “missing” APIs
Some APIs were hidden for normal usage. To light them up, you
need to add an using for AutoMapper. Internal and call the Internal
extension method on the configuration object.…

Alex Kudryashev
- 9,120
- 3
- 27
- 36
0
votes
1 answer
Why does AutoMapper throw an InvalidCastException when mapping this getter-only property?
From what I've read, AutoMapper is supposed to ignore getter-only properties. But with the configuration below the mapper throws an InvalidCastException due to this getter-only property
using AutoMapper;
var config = new MapperConfiguration(cfg…

cfmmark
- 3
- 1
0
votes
1 answer
AutoMapper 11 behaviors of mapping ReadOnlyCollection property
I'm new to AutoMapper, I want to post this issue on their github, but considering their issue template:
If you're new to AutoMapper, please ask a question on StackOverflow first and come back here if the people there consider it a bug.
I have to…

huang
- 919
- 11
- 22
-1
votes
1 answer
Automapper only creates new object without map
I have two objects which I can't map.
Here are my objects definitions:
public class DcMarkupValue
{
public DateTime StartDate { get; }
public DateTime EndDate { get; }
public decimal MarkupPrice { get; }
public decimal MarkupChange…

Anton Putau
- 632
- 1
- 7
- 31