-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
测试用例合理性讨论 #16
Comments
同理,AppendData(items)的时候,Id有效情况下,是否也应该跳过插入 |
问题2, var inarray = new[] { 1, 2, 3 };
var inList = inarray.ToList();
var list = select.Where(a => inList.Contains(a.testFieldInt)).ToList();
var list1 = select.Where(a => !inList.Contains(a.testFieldInt)).ToList(); 报错 未实现函数表达式, |
插入跳过的潜规则,目前只跳过列表中null的对象,是否会增加解释成本啊,因为确实会有id>0仍然执行。 list.Container 应该是没测试到位,我记录一下 |
这种场景感觉会出现异常呀,可能是用户处理不当,例如 Add/Edit 的操作,对应MVC的一个Action,仅按照id判断是进行编辑还是新增~ 这个是框架设计问题,也不是一定就是错的,说清楚就好 |
👍,是通用的IEnumerable/ IList 接口,还是其他 |
IList,因为它是独立的 Contains |
针对这个问题,可不可以在 FreeSql.Repository 的 filter 上实现约束。 |
可以呀,例如初始化的时候, new FreeSql.FreeSqlBuilder(options => {
options.InsertOptions.InsertWithExistPrimaryKey = InsertWithExistPrimaryKey.ThrowException;
});
// ThrowException, Skip, IngoreAndCreateNew , Default: ThrowException 类似吧,放在Repository都可以 |
参考下别人的做法,这方面还是要看具体框架明确下来,就好了 |
现在配置这块确实有些乱。 FreeSqlBuilder 那里的 一堆 UseXxx,哈哈 |
SqlServerInsertTest.cs
增加
预期item.Id > 0的时候,应该是会跳过吧?
或者是可配置?
The text was updated successfully, but these errors were encountered: