Base solution for your next web application
Open Closed

Roles to ListDto #2867


User avatar
0
asrar created

Hi,

I am using the function below to get a list of all roles:

var _rolesAsync = await _roleRepository.GetAllListAsync();

I am getting the right values here. The return object is List<Role>. How do I convert this object to ListResultDto<RoleListDto> so i can return it to my modal? _rolesAsync does not have a MapTo function hence stuck.

Thanks so much.


1 Answer(s)
  • User Avatar
    0
    asrar created

    Resolved it, I had forgotten to add reference to the AutoMapper class.