Dapper-FluentMap icon indicating copy to clipboard operation
Dapper-FluentMap copied to clipboard

System.Exception: 'Duplicate mapping detected. Property 'Level' is already mapped to column 'Level'.'

Open drma-tech opened this issue 5 years ago • 3 comments

public class BadgeMapper : EntityMap<BadgeVM>
    {
        public BadgeMapper()
        {
            Map(p => p.Rank.Level)
                .ToColumn("Rank_Level");

            Map(p => p.Seniority.Level)
                .ToColumn("Seniority_Level");

            Map(p => p.CompletedProfile.Level)
                .ToColumn("CompletedProfile_Level");

            Map(p => p.VerifiedProfile.Level)
                .ToColumn("VerifiedProfile_Level");

            Map(p => p.Popular.Level)
                .ToColumn("Popular_Level");
        }
    }

I saw that you had a similar ticket. I don't know if it's the same situation, but the error is the same.

drma-tech avatar Nov 08 '20 16:11 drma-tech

Do you have a full stack trace?

henkmollema avatar Nov 10 '20 08:11 henkmollema

   at Dapper.FluentMap.Mapping.EntityMapBase`2.ThrowIfDuplicateMapping(IPropertyMap map)
   at Dapper.FluentMap.Mapping.EntityMapBase`2.Map(Expression`1 expression)
   at VerusDate.Shared.Mapper.BadgeMapper..ctor() in C:\Users\dhiog\source\repos\drma-dev\VerusDate\src\Shared\Mapper\BadgeMapper.cs:line 13

It doesn't help much. But this is easy to reproduce, because I believe that the component is not recognizing attributes of another class

drma-tech avatar Nov 10 '20 13:11 drma-tech

Are there no plans to support attributes of other classes? Like value objects? @henkmollema

drma-tech avatar Nov 20 '20 18:11 drma-tech