添加新增实体的示例数据
在Libraries\Nop.Services\Installation\CodeFirstInstallationService.cs文件中添加服务成员变量:
private readonlyIRepository<Link>_linkRepository;
然后给CodeFirstInstallationService构造函数添加对应的参数IRepository<LinkModel>linkRepository,并给_linkRepository赋值。
接着添加函数:
protected virtualvoid InstallLinks()
{
List<Link> links =newList<Link>()
{
new