我正在使用Entity Framework的Code First功能,我正在试图弄清楚如何指定在自动生成数据库时应该创建的列数据类型.
我有一个简单的模型:
public class Article
{
public int ArticleID { get; set; }
public string Title { get; set; }
public string Author { get; set; }
public string Summary { get; set; }
public string SummaryHtml { get; set; }
public string Body { get; set; }
public string BodyHtml { get; set; }
public string Slug { get; set; }
public DateTime Published { get; set; }
public DateTime Updated { get; set; }
public virtual …Run Code Online (Sandbox Code Playgroud) c# entity-framework sql-server-ce data-annotations ef-code-first