我觉得我错过了一些非常简单的东西......我刚开始使用数据库优先实体框架项目,我一直在让生成的类工作的问题。我有我的图设置和数据库是正确的,但生成的EDMX有问题。生成的类无法找到模型
PaymentData.cs(生成)
//------------------------------------------------------------------------------
// <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 Project.Web.Models
{
using System;
using System.Collections.Generic;
public partial class PaymentData
{
public int Id { get; set; }
public virtual Account Account { get; set; }
}
}
的“账户”的模式不能被发现,即使是Account.edmx在同一个文件夹中,用相同的命名空间,并通过实体生成框架。那么为什么不能生成这个文件(找到这个模型)?我之前做过代码优先,从来没有遇到过这个问题,所以这让我发疯了!
您是否尝试过重建?它可能有时是一个问题.. – Tyress 2014-11-07 03:47:52
我没有,但是修复它。看起来模型很长,我甚至懒得去检查。干杯! – adamdabbracci 2014-11-10 04:37:15