I have a simple object with a default constructor. The objects I'm mapping to and from are both defined exactly the same and I've configured a mapper for them. Everything works fine getting the object from the database.
public class Tag
{
public Guid ProjectId { get; set; }
public Guid TagId { get; set; }
public string Name { get; set; }
}
If I call Mapper.Instance.Map(tagFrom, tagTo); everything works fine, but if I call dbContext.Tags.Persist().InsertOrUpdate(tag); I get this error.
Unmapped members were found. Review the types and members below. Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
AutoMapper created this type map for you, but your types cannot be mapped using the current configuration.
AutoMapper created this type map for you, but your types cannot be mapped using the current configuration. Tag -> Expression
1 (Destination member list) AKS.Common.Models.Tag -> System.Linq.Expressions.Expression1[[System.Func`2[[AKS.AppCore.Entities.Tag, AKS.AppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] (Destination member list)Unmapped properties:
Parameters
No available constructor.
Seems like it's saying I have no default constructor, but clearly there is one. Anyone know what I'm doing wrong?
Package Versions: AutoMapper 8.0.0 AutoMapper.Collections 5.0.0 AutoMapper.Collections.EntityFrameworkCore 0.2.0
TopicEdit, and alsoExpression<Func<TopicEdit, bool>>, so make sure the code you post reproduces the issue. - Ivan StoevCreateMap<Tag, Tag>()to AM configuration. However there seems to be some equivalency expression bug, so the feature is not working at all (does wrong things because the expression isGuidX == GuidX, e.g.true, soFirstOrDefault()will return random item rather than the one that needs to be updated/deleted). Consider posting an issue to their tracker. - Ivan Stoev