繁体   English   中英

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

[英]Entity Framework from Database Generate Namespace Errors

我正在从数据库生成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; }
}
}

我在构建时遇到以下错误:

using名称空间指令只能应用于名称空间。 “系统”是类型而不是名称空间

找到了问题。 抱歉,我不清楚这个问题。 我在这里显示了确切的问题但没有意识到我的桌子是引起此问题的原因。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM