【发布时间】:2013-07-31 07:28:34
【问题描述】:
我想使用Column 数据注释,如下面的示例代码所示,但编译器(以及 IntelliSense)似乎不知道该特定数据注释。我在 Visual Studio 2010 中使用 EF 5。我使用 NuGet 安装了 EF 5。 Required 和 MaxLength 注释正在工作。
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Model
{
public class Destination
{
public int DestinationId { get; set; }
[Required]
public string Name { get; set; }
public string Country { get; set; }
[MaxLength(500)]
public string Description { get; set; }
[Column(TypeName="image")]
public byte[] Photo { get; set; }
public List<Lodging> Lodgings { get; set; }
}
}
我错过了什么?
【问题讨论】:
标签: visual-studio-2010 entity-framework c#-4.0 entity-framework-5 data-annotations