fluent-nhibernate icon indicating copy to clipboard operation
fluent-nhibernate copied to clipboard

Purpose of OptimisticLock.Version()?

Open behrygood1982 opened this issue 4 years ago • 0 comments

Hello,

I couldn't find this in the documentation but can someone please explain the purpose of OptimisticLock.Version() inside a classmap? From what i can tell, it does nothing. The below map works fine without it when using a version column.

 public class PersonOptimisticConcurrencyVersionMap : ClassMap<PersonOptimisticConcurrencyVersion>
    {
        public PersonOptimisticConcurrencyVersionMap()
        {
            Id(x => x.Id).GeneratedBy.Identity();
           
             // This does nothing
            // OptimisticLock.Version();
            // Use a version column which is recommended
            Version(x => x.OptimisticConcurrencyVersion);

            Map(x => x.FirstName).Not.Nullable();
            Map(x => x.LastName).Not.Nullable();
        }
    }

behrygood1982 avatar May 22 '21 12:05 behrygood1982