Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/27.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# 更新的数据未显示在视图中(MVC 5、EF、SQL依赖项)_C#_Sql Server_Asp.net Mvc_Entity Framework_Sqldependency - Fatal编程技术网

C# 更新的数据未显示在视图中(MVC 5、EF、SQL依赖项)

C# 更新的数据未显示在视图中(MVC 5、EF、SQL依赖项),c#,sql-server,asp.net-mvc,entity-framework,sqldependency,C#,Sql Server,Asp.net Mvc,Entity Framework,Sqldependency,我想在数据库的视图中显示更新的数据。我正在使用sql依赖的输出缓存 以下是控制器: [OutputCache(Duration = 3600, Location = System.Web.UI.OutputCacheLocation.Server)] public ActionResult List() { var project = unitOfWork.ProjectRepository .Get().AsEnumerable(

我想在数据库的视图中显示更新的数据。我正在使用sql依赖的输出缓存

以下是控制器:

[OutputCache(Duration = 3600, Location = System.Web.UI.OutputCacheLocation.Server)]
public ActionResult List()
{
    var project = unitOfWork.ProjectRepository
                            .Get().AsEnumerable()
                            .Where(p => p.IsDeleted == 0)
                            .Select(p => new Project { ProjectID = p.ProjectID, Name = p.Name })
                            .OrderBy(p => p.Name)
                            .ToList();

    string jsondata = new JavaScriptSerializer().Serialize(project);

    return Json(jsondata, JsonRequestBehavior.AllowGet);
}
web.config

<caching>
    <sqlCacheDependency enabled="true" pollTime="2000">
        <databases>
            <add name="DSS" connectionStringName="DocumentStorageContext"/>
        </databases>
    </sqlCacheDependency>
</caching>