2011-06-09 54 views
0

在配置屬性(名稱爲字符串,RowVersion是字節)實體框架4.1流利的API特性

這工作:

Me.Property(Function(t) t.Name).IsRequired().IsFixedLength.HasMaxLength(10) 

但是這給了我一個錯誤:

Me.Property(Function(t) t.RowVersion).IsRequired().IsFixedLength().HasMaxLength(8) 

錯誤是:

'IsFixedLength' is not a member of 'System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration'

任何建議爲什麼?

回答

1

Because it isn't.您可以在字符串上調用IsFixedLength(),但不要在TIMESTAMP上調用IsFixedLength()。同上HasMaxLength()。無論如何,你會期望DB如何配置這樣的配置?