using (IDataReader dr = DatabaseContext.ExecuteReader(command))
{
if (dr.Read())
{
AutoMapper.Mapper.CreateMap<IDataReader, ProductModel>();
return AutoMapper.Mapper.Map<IDataReader, IList<ProductModel>>(dr);
}
return null;
}
if dr has only one row -> error: threw an exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException'
if dr has more than one row, it run ok.
any help?