0
comment
on 8/17/2015 11:26 AM
In Code First Entity Framework models, you can define the length of a string field with StringLengthAttribute, but you have to write code in OnModelCreating to indicate a CHAR/NCHAR fixed length field: public class MyEntity { [Key] public int Id { get; set; } [StringLength(2)] public string FixedLengthColumn { get; set; } } public partial class MyContext : DbContext { public virtual DbSet MyEntities { [...]
>> Read the full article on blogs.teamb.com
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper