Claire
Claire

Reputation: 11

Entity Framework 4.1 Fluent API property

When configuring a property (Name is String, RowVersion is Byte)

This works:

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

But this gives me an error:

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

The error is:

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

Any suggestions why?

Upvotes: 0

Views: 582

Answers (1)

Craig Stuntz
Craig Stuntz

Reputation: 126557

Because it isn't. You can call IsFixedLength() on a string, but not on a TIMESTAMP. Ditto for HasMaxLength(). What would you expect the DB to do with such a configuration, anyway?

Upvotes: 1

Related Questions