【发布时间】:2014-11-09 08:07:27
【问题描述】:
是否可以在实体框架中存储IEnumerable<string>?
我在 ASP.NET MVC5 中使用代码优先,我有一个看起来有点像这样的模型,但 ImageUris 在我的数据库中没有作为列出现(所有其他属性都出现)。
public class Product
{
[Key]
public int Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Condition { get; set; }
public decimal Price { get; set; }
public IEnumerable<string> ImageUris { get; set; }
}
PS:如果您对我为什么要存储 Uris 而不是图像本身感兴趣,它们是 Azure 存储 Blob 的 uri。
【问题讨论】:
标签: entity-framework asp.net-mvc-5