ASP.net MVC5 data Annotation problem

1. I want to use EF6"s Code First to create my application, but I have a field type in the database for text type, I would like to ask whether it can only be expressed as String type in Model at this time, if so, should I specify data annotation StringLength? In addition, I would like to ask, is there a way to represent the database field as an enumerated type or a Set type?
2. My database is sql server 2008R2, please know how to give me some advice, thank you!

Mar.16,2021

1. For fields of text type in the database, you can use the string type in Model to represent them. There is no need to specify StringLength

.

2. For fields of enumerated types, define enumerations in the code, and then identify them with the enumerated type EnumDataType attribute on the property, as follows:

public enum Browser
{
    Chrome,
    Firefox
}

public class YourClass
{
    [EnumDataType(typeof(Browser))]
    public Browser Browser{get;set;}
    ...
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b387c2-2c113.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b387c2-2c113.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?