提交 fd95d705 编写于 作者: A Adam Schroder

Tidy up error message when creating an object

上级 27389971
......@@ -36,7 +36,7 @@ public override object Map(DbDataReader dataReader, RowMapperContext context)
{
context.Instance = context.PocoData.CreateObject(dataReader);
if (context.Instance == null)
throw new Exception(string.Format("Cannot create POCO '{0}'. It may have no parameterless constructor or be an interface or abstract class without a Mapper factory.", context.Type.FullName));
throw new Exception(string.Format("Cannot create POCO '{0}'. It may be an interface or abstract class without a Mapper factory.", context.Type.FullName));
}
else
{
......@@ -75,7 +75,7 @@ private IEnumerable<MapPlan> BuildMapPlans(GroupResult<PosName> groupedName, DbD
{
// find pocomember by property name
var pocoMember = pocoMembers.FirstOrDefault(x => IsEqual(groupedName.Item, x.Name)
|| IsEqual(groupedName.Item, x.PocoColumn?.ColumnAlias));
|| string.Equals(groupedName.Item, x.PocoColumn?.ColumnAlias, StringComparison.OrdinalIgnoreCase));
if (pocoMember == null)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册