Open Closed

MapTo #1905


0
epayday created

Hi, I am trying to replicate part of the tutorial PhoneBook in regards to displaying the contents on a page of another table in the database, PayRateType table. In my PayRateTypeAppService class I have the following line of code.

return new ListResultDto<PayRateTypeListDto>(PayRateType.MapTo<List<PayRateTypeListDto>>());

For this line of code I get the following error. Error CS0117 'PayRateType' does not contain a definition for 'MapTo" The equivalent Person class does not appear to contain a definition for "MapTo" either, however this does not create an error? I think there is something going on behind the scene, but I am not sure how / why it works for the phonebook example and not for ours. Thanks,


1 Answer(s)
  • 0
    hikalkan created
    Support Team

    MapTo is an extension method. Normally, we would expect that your IDE finds it. Just add this to your code file

    using Abp.AutoMapper;