Missing type map configuration or unsupported mapping.
Hi , when i am converting model and entity in repository i am getting this issue.can anyone help me on this very urgent.This is my code.
// List<CityModel> cityModel = null;
//List<City> city = null;
var city = _genericimplentation.CityRepository.GetAll().ToList();
if (city.Any())
{
//Mapper.CreateMap<City, CityModel>();
try
{
//cityModel = Mapper.Map(city, cityModel);
Mapper.CreateMap<City, CityModel>()
.ForMember(d => d.CityType, option => option.Ignore())
.ForMember(d => d.ID, o => o.MapFrom(c => c.ID))
.ForMember(d => d.CityName, o => o.MapFrom(c => c.CityName));
// Mapper.AssertConfigurationIsValid();
var citidata =Mapper.Map<List<City>, List<CityModel>>(city);
return citidata;
}
catch (Exception ex)
{
throw ex;
}