0
我有其中包含,字节数组称为邮票,编号和状态,这每一个实体继承我映射邮票EF 4.1.3 Implenting Rowversion并发不工作
Property(t => t.Stamp).IsRequired().IsRowVersion();
一个BaseEntity类
这在BaseEntityConfiguration 被设置这样
public BaseEntityConfiguration<T> : EntityTypeConfiguration<T> where T :B aseEntity
的映射是这样
var baseMapConfiguration = new BaseEntityConfiguration<EntityA>();
modelBuilder.Configurations.Add(baseMapConfiguration);
var entityAMap = new EntityAMap(baseMapConfiguration);
进行设定
数据库的标志ROWVERSION NOT NULL;上表EntityA 我有一个处理DbUpdateConcurrencyException代码,但这并不被逮住,即使邮票不同 还没有在那里与我会预计
SELECT
[Extent1].[Id] AS [Id],
[Extent1].[LastModified] AS [LastModified],
[Extent1].[CreatedDate] AS [CreatedDate],
[Extent1].[Stamp] AS [Stamp]
FROM [dbo].[EntityA] AS [Extent1]
当你看到任何印花税场条款在哪里声明我也尝试过,但是仍然得到相同的结果
**我发现问题EF正在获取最新的Rowversion而不是传入一个,我该如何阻止此问题。 **