我已经搜索了这个答案的高低,但找不到任何东西......我是不是很愚蠢?
protected override void Seed(MyContext context)
{
context.Items.Add(new Item
{
URL = "my-url-field",
Title = "My Title for this Item",
Image = "some-image-file.jpg" // this is httppostedfilebase - how to seed this?
});
}
我想我必须实例化一个 httppostedfilebase 的对象,但我该怎么做呢?