public List <DeviceTypeDto> GetAllDevicesType() { List <DeviceTypeDto> result = new List <DeviceTypeDto>(); //Mapper.AssertConfigurationIsValid(); var received2 = _deviceTypeRepository.GetAllDeviceType(_dbContext).ToList(); Mapper.CreateMap <DeviceType, DeviceTypeDto>(); result = Mapper.Map <List <DeviceType>, List <DeviceTypeDto> >(received2); return(result); }