Einzelnen Beitrag anzeigen

Benutzerbild von DP News-Robot
DP News-Robot

Registriert seit: 4. Jun 2010
15.010 Beiträge
 
#1

Adding a [FixedLength] Attribute in Code-First Entity Framework

  Alt 17. Aug 2015, 20:10
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 ...

More...
  Mit Zitat antworten Zitat