OpenIddict 不能使用 Cosmos 作为数据库,因为支持 ETag 并发

问题描述

我正在尝试使用 Azure Cosmos DB 作为我的 OpenIddict DB:

   options.UseCosmos(...) in Startup.cs
                
        

并且我收到以下异常

The entity type 'CustomOpenIdApplication' has property 'ConcurrencyToken' as its concurrency token,but only '_etag' is supported. Consider using 'EntityTypeBuilder.UseETagConcurrency'.'

我已经尝试将以下内容放入我的 DBContext 中,但发生了同样的问题。

 protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
             modelBuilder.Entity<CustomOpenIdApplication>().Property(b => b.ConcurrencyToken)
                .IsETagConcurrency();}

如何解决这个问题,因为似乎 OpenIddict 被设计为使用 ConcurrencyToken 而不是 Etag 进行并发,但异常明确表示仅支持 Etag 并发。

请注意,如果我使用 sqlserver 作为我的数据库,那么我没有任何问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)