EF 直接执行SQL 提示检测到无法访问的代码 是怎么回事

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

using (var scope = _dbContextScopeFactory.Create())
{
var db = scope.DbContexts.Get<JuCheapContext>();
AcrpreplaceEntity entity = _mapper.Map<AcrpreplaceAddDto, AcrpreplaceEntity>(dto);
entity.Id= BaseIdGenerator.Instance.GetId();
entity.CRP = Lib.SessionBox.RealName;
entity.CRT = DateTime.Today;
db.Set<AcrpreplaceEntity>().Add(entity);
return scope.SaveChanges() > 0;
db.Database.ExecuteSqlCommand("exec Acrpreplace");
}
在 db.Database.ExecuteSqlCommand("exec Acrpreplace"); 提示 检测到无法访问的代码 ,不知道是什么原因,谢谢各位大神
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
zhengyingcan
.NET社区 62,272 成员 668,968 内容