Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Edition mapping fails #4615


User avatar
0
vladsd created

When you setup edition to have monthly and annual price and go edit again it fails to show price you set. While price is set in database correctly, mapping between database object and dto object fails to map decimals. Here is a link where it fails.

editionEditDto = ObjectMapper.Map<EditionEditDto>(edition);

edition has values for monthlyprice and annualprice, while editionEditDto has them as nulls after mapping.

Any advise how to fix this bug?


4 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    It might be related to a missing map in CustomDtoMapper.cs that added in v5.1:

    <span style="color:#FF0000">- configuration.CreateMap<EditionEditDto, SubscribableEdition>();</span> <span style="color:#008000">+ configuration.CreateMap<EditionEditDto, SubscribableEdition>().ReverseMap();</span>

  • User Avatar
    0
    BobIngham created

    See: [https://github.com/aspnetzero/aspnet-zero-core/issues/706#event-1406083638])

  • User Avatar
    0
    vladsd created

    Thanks, I just downloaded asp.net zero bundle 1 week ago, so I got an old version! Hmmmm.

    Is there an easy way to bring the version or I have to import one fix at a time?

  • User Avatar
    0
    aaron created
    Support Team

    Is there an easy way to bring the version or I have to import one fix at a time?

    How to migrate existing solution: https://github.com/aspnetzero/aspnet-zero/issues/96#issuecomment-268093697

    For this fix, you can just make that single-line change.