Category "automapper"

The instance of the entity type cannot be tracked because another instance with the keyvalue is being tracked

I am basically trying to implement CRUD using EntityFrameWork core and .Net core 3.1. I have an issue with my update operation where I am not able update the co

Autmapper map collections of different types to collection of another type with nesting

I am currently struggling with automapper.10.1.1 config. I have following types: class Response { List<Assignment> Assignments { get; } List<Pr

How to map Object to KeyValuePair<char, string> using AutoMapper?

I'm trying to map my object model to a KeyValuePair<char, string> but my results are KeyValuePairs where Key = null and Value = null. What's the correct w

why dbcontext.savechanges() donot clear tracked entites of this dbcontext in efcore

I have an error on update entities use efcore and automapper: Entity cannot be tracked because another instance is with the same key value I saw some answers an

Map nested object with Automapper in C#

I use the latest version of AutoMapper 10.1.1 in my .NET Core project. I have a simple database for learning new words in a language I want to learn. I have the

Automapper profile maps its props to my dto

Hi. I want just map entity to dto but profile props map to the dto. Now what can i do for the following problem? public abstract class DtoProfile<TEntity

How to use Automapper to project object to Dto in LINQ

I am working on .NET Core 6 along with EF Core. I want to convert Customer and Order object that I have inside LINQ select to CustomerDto and OrderDto using Pro

How to setup AutoMapper in ASP.Net Core 6

How to configure AutoMapper in ASP.Net Core 6 I have a project which is written in .Net 3.1 so we had Startup.cs class. I am migrating it to .net core 6 now whe

AutoMapper .NET6 C#10 Blazor WASM PWA

I had a problem that the AutoMapper worked in .NET5 with in Program.cs -> services.AddAutoMapper(typeof(Startup)); New Blazored WASM PWA do not have a Startu

AutoMapper - Trying to flatten my object property to string but getting an error

I am trying to map my ProductDto to Product class. I get an error when mapping the string property in ProductDto class to a Brand property in the Product class.

Simple way to add extra parameter to Automapper ForMember

So, I have a mapping ObjectFrom to ObjectTo. ' All mappings can be done ObjectFrom.propX -> ObjectTo.propX2. But there is also a property in ObjectTo that ne

How can I pass parameters to an AutoMapper Profile in ABP?

I need to customize the way MyAutoMapper profile maps my objects to DTOs. From one of my ApplicationServices, I use an ObjectMapper for a relatively simple mapp

Update Entity from ViewModel in MVC using AutoMapper

I have a Supplier.cs Entity and its ViewModel SupplierVm.cs. I am attempting to update an existing Supplier, but I am getting the Yellow Screen of Death (YSOD)

Cannot convert lambda expression to type 'IValueResolver<Entity, MyDto, object>' because it is not a delegate type

I am trying to define this simple mapping in my profile CreateMap<CompanyClient, MyDto>() .ForMember( dto => dto.PaymentTerms, opt => opt.M

AutoMapper convert from multiple sources

Let's say I have two model classes: public class People { public string FirstName {get;set;} public string LastName {get;set;} } Also have a class Phone:

Automapper:Converting JSON to list of objects

Source Object (JSON, using JSON.NET if it matters): { "conum" : 1001, "name" : "CLN Industries Corporation", "agencyName" : "Murphy, Holmes & A

Problem in Azure DevOps pipeline restoring AutoMapper NuGet package in .net 6

I get the following error message when my pipeline is being run: Package AutoMapper.Extensions.Microsoft.DependencyInjection 8.1.1 is not compatible with net60

automapper map interface to interface or object

How to map objects inherited from one interface to objects inherited from another interface. I have such code structure public interface IDataTranslatable {