流畅的nhibernate automap版本列

发布于 2024-08-20 05:14:09 字数 380 浏览 2 评论 0原文

我的约定中的当前代码:

    public void Apply(FluentNHibernate.Conventions.Instances.IVersionInstance instance)
    {
        instance.Column("RowVersion");
        instance.Not.Nullable();
        instance.UnsavedValue("0");
        instance.Default(1);
    }

这不会将 RowVersion 呈现为版本列。它将 RowVersion 视为另一列。

所以我的问题是如何使用 Fluent Nhibernate 添加行版本并发?

Current code in my convention:

    public void Apply(FluentNHibernate.Conventions.Instances.IVersionInstance instance)
    {
        instance.Column("RowVersion");
        instance.Not.Nullable();
        instance.UnsavedValue("0");
        instance.Default(1);
    }

This doesn't render the RowVersion as a version column. It treats RowVersion as just another column.

So my question is how do you add Row Version Concurrency using Fluent Nhibernate?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧伤还要旧人安 2024-08-27 05:14:09

VersionStep 类仅查找与 VersionTimestamp 名称匹配的属性。您的财产必须与该名称相匹配。另一种选择是替换 VersionStep 来更改命名规则。

The VersionStep class only looks for properties that match the names of Version or Timestamp. Your property will have to match that name. Replacing VersionStep to change the naming rules is another option.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文