【发布时间】:2020-09-28 21:25:58
【问题描述】:
考虑这个简单的类,我将在 EF Core 3.1 中将它用于我的一个域对象:
using System;
namespace Blah.Domain
{
public class Response
{
public int Id { get; set; }
public string FullResponseText { get; set; }
public string HttpResponseCode { get; set; }
public string TransactionId { get; set; }
public string TransactionType { get; set; }
public DateTime CreatedDate { get; set; }
}
}
拥有数据库背景,我不想在我的数据库 (SQL Server) 中使用默认类型 nvarchar(max) 作为字符串值的列类型。 EF创建表时如何指定列类型?
另外,我是否必须包含整个 SYSTEM 命名空间才能让我的 CreatedDate 字段可以使用 DateTime 选项,还是有其他方法?
【问题讨论】:
标签: c# sql-server .net-core entity-framework-core