Entity framework EF:新存储过程字段返回空值

Entity framework EF:新存储过程字段返回空值,entity-framework,visual-studio-2012,Entity Framework,Visual Studio 2012,我刚刚在我的存储过程中添加了几个字段,它使用EF连接到我的MVC应用程序,但是新字段返回空值,即使模型已经更新并且看起来很好 //------------------------------------------------------------------------------ // <auto-generated> // This code was generated from a template. // // Manual changes to this f

我刚刚在我的存储过程中添加了几个字段,它使用EF连接到我的MVC应用程序,但是新字段返回空值,即使模型已经更新并且看起来很好

//------------------------------------------------------------------------------
// <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 MyNamesSpace
{
    using System;

    public partial class MyStoredProcedure_Result
    {
        public Nullable<int> myfield1 { get; set; }
        public string myfield2 { get; set; }
        public string myfield3 { get; set; }
        public Nullable<int> myfiel14 { get; set; }
        public string myNEWFIELD { get; set; }  // always returns null
        public string test { get; set; }  // always returns null
    }
}
当我硬编码一个值时,测试字段怎么能返回null


编辑:我继续重新创建了整个模型,解决了这个问题。我会一直保留旧的进程,直到我能准确地找出两者之间的区别,并且会在我发现的时候或大的时候发回。

存储的进程是两步过程,对吗?刷新模式,使模型知道过程,然后必须创建到实体的映射。听起来像是您进行了刷新,但没有将新列添加到映射中?我知道可能是这样的,但我确实从数据库更新了模型,然后进入模型浏览器,单击“获取列信息”,然后单击“更新”,然后单击“确定”。我想这些都是步骤。。。
Select from mytable
[..other query lines..]
"test" as test