Replies: 3 comments
-
I think we need to add Here is the code that I try to test if can update version number. var car = new Car()
{
Name = "Honda",
Version = 111
};
_session.Save(car); and the result:
We can then set Version property from form's input. If the version has changed, |
Beta Was this translation helpful? Give feedback.
-
The following code throws var car = await _session.GetAsync<Car>(1421);
car.Version = 110;
car.Name = "Honda";
_session.Save(car, checkConcurrency: true); |
Beta Was this translation helpful? Give feedback.
-
The version property is read by YesSql which uses Refection so setting contentItem.Content.Version = 111 does not work. |
Beta Was this translation helpful? Give feedback.
-
I know that there are some optimistic check options in Orchard Core CMS project.
However, I can't reason this will work. This is because according to YesSql project.
We need to have
Version
property in Document type because we don't overrideVersionAccessorFactory
configuration in/src/YesSql.Core/Configuration.cs
of YesSql project.I also couldn't find any code in Orchard Core project that tries to set a version number from a form input to content item/content part for optimistic lock checking.
I would be glad if you could explain or give me some example to get optimistic lock work in Orchard Core project.
Thank you.
FYI, this test in YesSql project is a good one.
https://github.com/sebastienros/yessql/blob/main/test/YesSql.Tests/CoreTests.cs#L5899
Beta Was this translation helpful? Give feedback.
All reactions