Hi amitsinghr,
Default length of string field in code first is 128. If you are using EF validation it will throw exception. You can extend the size by using
1
2
|
[StringLength(Int32.MaxValue)]
public string Body { get ; set ; }
|
Second approach which also work
1
2
|
[MaxLength]
public string Body { get ; set ; }
|
StringLengthAttribute is from System.ComponentModel.DataAnnotations assembly
MaxLengthAttribute is from EntityFramework assembly (EF 4.1)