我正在尝试出于学习目的进行以下项目: https ://docs.microsoft.com/ru-ru/aspnet/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-表格/create_the_data_access_layer
但我被困在“更新 Global.asax 文件”这一步——VS 不允许我将 WingtipToys.Models 命名空间导入 Global.asax.cs 文件。
一切都是按照上面微软的教程完成的。为什么我不能将我的模型导入 global.asax.cs 文件?
我的 ProductDatabaseInitializer 类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
namespace WingtipToys.Models
{
public class ProductDatabaseInitializer : DropCreateDatabaseIfModelChanges<ProductContext>
{
protected override void Seed(ProductContext context)
{
GetCategories().ForEach(c => context.Categories.Add(c));
GetProducts().ForEach(p => context.Products.Add(p));
}....