
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"); 提示 检测到无法访问的代码 ,不知道是什么原因,谢谢各位大神