Entity Framework Data Annotations Set StringLength VarChar

Use ColumnAttribute to give the datatype

[Column(TypeName = "VARCHAR")]
[StringLength(250)]
public string Comment { get; set; }

Or use fluent API

modelBuilder.Entity<MyEntity>()
  .Property(e => e.Comment).HasColumnType("VARCHAR").HasMaxLength(250);

Leave a Comment

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.