Search code examples
aspnetboilerplate

Error mapping types after updating to abp 2.3.0


after updating abp from 1.4.2 to 2.3.0 i got an error while trying to map entity to a Dto

 var articles = _articleRepository.GetAll().Where(p => p.ProductId == id);
 var mappedArticles = ObjectMapper.Map<List<ArticleListItemDto>>(articles);

it gives me error mapping types, everything was working before and after the update it's not working

also it throw exception for lazy loaded properties only while mapping, if i tried GetAllIncluding instead of GetAll the mapper is working fine


Solution

  • I fixed it by adding the below configuration to the connection string.

    MultipleActiveResultSets=true;