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);
More Related Contents:
- ASP.NET MVC 2.0 Implementation of searching in jqgrid
- Code First: Independent associations vs. Foreign key associations?
- Reset Entity-Framework Migrations
- No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’
- Unique Key constraints for multiple columns in Entity Framework
- How do I delete multiple rows in Entity Framework (without foreach)
- How to mock the limitations of EntityFramework’s implementation of IQueryable
- Batch update/delete EF5
- Database first create entity framework 6.1.1 model using system.data.sqlite 1.0.93
- how to update an entity in Entity Framework 4 .NET
- Should I enable or disable dynamic proxies with entity framework 4.1 and MVC3?
- Entity Framework 4 / POCO – Where to start? [closed]
- Asp.Net Web API Error: The ‘ObjectContent`1’ type failed to serialize the response body for content type ‘application/xml; charset=utf-8’
- “like” queries in Entity Framework
- Entity Framework: Ignore Columns
- Entity framework PostgreSQL
- mapping private property entity framework code first [duplicate]
- MVC3 and Code First Migrations – “model backing the ‘blah’ context has changed since the database was created”
- EF can’t infer return schema from Stored Procedure selecting from a #temp table
- MetadataException when using Entity Framework Entity Connection [duplicate]
- How to create index in Entity Framework 6.2 with fluent configuration
- Using Entity Framework with an SQL Compact Private Installation
- Mocking or faking DbEntityEntry or creating a new DbEntityEntry
- How to use Entity Framework to map results of a stored procedure to entity with differently named parameters
- EF 4.1 loading filtered child collections not working for many-to-many
- How to map Table per Type (TPT) inheritance in Entity designer?
- DbContext AutoDetectChangesEnabled set to false detecting changes
- Using the Entry().CurrentValues.SetValues() is not updating collections
- .NET 4.5 Beta DbGeography NotImplementedException
- An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key