using (IDataReader dr = DatabaseContext.ExecuteReader(command))
{
if (dr.Read())
{
AutoMapper.Mapper.CreateMap<IDataReader, ProductModel>();
return AutoMapper.Mapper.Map<IDataReader, IList<ProductModel>>(dr);
}
return null;
}
如果 dr只有一行-> 错误:抛出类型为“Microsoft.CSharp.RuntimeBinder.RuntimeBinderException”的异常
如果 dr 有不止一排,它运行正常。
有什么帮助吗?