-
Notifications
You must be signed in to change notification settings - Fork 4
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
ArgumentNullException on update #4
Comments
I do not get any error with 15.2.4. I have updated the source code to the DevExpress 15.2.4 and all tests are passing. |
The error occurs when i use a criteria (BinaryOperador) that causes a join. |
Ok I can replicate the problem now. Did this work in 15.2.3? |
I did not test in 15.2.3. |
Thanks for reporting this issue. I've looked around and it looks like it's not new. I guess criteria with joins have not been supported by XpoBatch for a long time, if ever. For instance, this issue T131050 in the DevExpress support center is the same issue and is two years old. For now I'm adding a test which demonstrates the issue, and I'll update this issue again in the new year when I've had time to investigate further. [Test]
/// This test fails because it requires a join in the criteria.
/// BaseQueryGenerator.AppendJoinNode get called with the Alias property of the
/// prevNode parameter set to null.
public void Test_ModifySome_String_WithReferenceCriteria()
{
CriteriaOperator criteria = MySimpleObject.Fields.ReferenceProperty.StringProperty == "B%";
using (UnitOfWork uow = new UnitOfWork(DefaultDataLayer))
{
int affectedRecords = uow.GetObjectCount<MySimpleObject>(MySimpleObject.Fields.StringProperty == "abcdefghjiklmnopqrstuvwxyz" & !criteria)
+ uow.GetObjectCount<MySimpleObject>(criteria);
uow.Update<MySimpleObject>(() => new MySimpleObject(uow) { StringProperty = "abcdefghjiklmnopqrstuvwxyz" }, criteria);
Assert.AreEqual(affectedRecords, uow.GetObjectCount<MySimpleObject>(MySimpleObject.Fields.StringProperty == "abcdefghjiklmnopqrstuvwxyz"));
}
} |
Method: public static ModificationResult Update(this Session session, Expression<Func> evaluator, CriteriaOperator criteria) where T : IXPObject
Line: List collection = UpdateQueryGenerator.GenerateUpdate(classInfo, properties, ObjectGeneratorCriteriaSet.GetCommonCriteriaSet(criteria), batchWideData);
Version: 15.2.4
The text was updated successfully, but these errors were encountered: