Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 数据库中的实体框架生成命名空间错误_C#_Asp.net_Entity Framework_Namespaces - Fatal编程技术网

C# 数据库中的实体框架生成命名空间错误

C# 数据库中的实体框架生成命名空间错误,c#,asp.net,entity-framework,namespaces,C#,Asp.net,Entity Framework,Namespaces,我正在从数据库生成一个EF模型,在EF生成的所有类上,我从自动生成的代码中得到了使用名称空间的错误 以下是其中一个类的示例: //------------------------------------------------------------------------------ // <auto-generated> // This code was generated from a template. // // Manual changes to this

我正在从数据库生成一个EF模型,在EF生成的所有类上,我从自动生成的代码中得到了使用名称空间的错误

以下是其中一个类的示例:

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace WebApplication5.Models
{
using System;
using System.Collections.Generic;

public partial class Flag
{
    public int ID { get; set; }
    public string Type { get; set; }
    public int UserGameID { get; set; }

    public virtual UserGame UserGame { get; set; }
}
}
//------------------------------------------------------------------------------
// 
//此代码是从模板生成的。
//
//手动更改此文件可能会导致应用程序出现意外行为。
//如果重新生成代码,将覆盖对此文件的手动更改。
// 
//------------------------------------------------------------------------------
命名空间WebApplication5.Models
{
使用制度;
使用System.Collections.Generic;
公共部分类标志
{
公共int ID{get;set;}
公共字符串类型{get;set;}
public int UserGameID{get;set;}
公共虚拟用户游戏用户游戏{get;set;}
}
}
我在生成时遇到以下错误:


using namespace指令只能应用于名称空间;'“系统”是一种类型,而不是一个命名空间。发现问题。对不起,我不清楚这个问题。我有确切的问题,但没有意识到是我的表造成了问题。

我在那里生成了一个类
系统
?Thx arnold我甚至没有意识到这是问题我有同样的错误,当使用系统时;使用System.Collections.Generic;命名空间外部我的错误已解决:O