c#项目出现类型“System.Decimal”的对象无法转换为类型“System.Int32”。异常,下划线是报错的地方

qq_24002703 qq_24002703 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Omu.ValueInjecter;

namespace MadMan.Li.Common.Data
{
public class ReaderInjection : KnownSourceValueInjection<IDataReader>
{
protected override void Inject(IDataReader source, object target)
{
for (var i = 0; i < source.FieldCount; i++)
{
var activeTarget = target.GetProps().GetByName(source.GetName(i),true);
if (activeTarget == null) continue;

var value = source.GetValue(i);
if (value == DBNull.Value) continue;

activeTarget.SetValue(target, value);
}
}
}
}
...全文

相关推荐

评论 20
收藏 已收藏
分享
返回顶部
qq_24002703
C# 111,128 成员 642,537 内容