我有以下实体模型:
public class Todo
{
[Required]
public int ID { get; set; }
public int OrderId { get; set; } //Not required
public string Description { get; set; }
public bool Finished { get; set; }
public DateTime CreationDate { get; set; }
public int Priority { get; set; } //Not required
public string CreatedBy { get; set; }
public bool Deleted { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
在相应的数据库表中,所有字段都创建为"not null".我想允许一些字段为空.我该怎么做呢?