Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
Wcf Microsoft.Data.Services.Client是否缓存数据?_Wcf_Caching_Odata_Wcf Data Services - Fatal编程技术网

Wcf Microsoft.Data.Services.Client是否缓存数据?

Wcf Microsoft.Data.Services.Client是否缓存数据?,wcf,caching,odata,wcf-data-services,Wcf,Caching,Odata,Wcf Data Services,我们使用的是Microsoft WCF数据服务的System.Data.Services.Client(我猜是第4版)。当我们更新到版本5.2(Microsoft.Data.Services.Client dll)时,似乎在新版本的WCF数据服务中插入了一些缓存机制 因为当我们通过浏览器查询数据服务(OData)时,会返回新的数据,但当我们向UI项目添加服务引用并使用该引用(代理)检索数据时,只有在大约10分钟后才会显示新的数据 通过重置IIS(iisreset.exe),可以获得新的数据,这可

我们使用的是Microsoft WCF数据服务的System.Data.Services.Client(我猜是第4版)。当我们更新到版本5.2(Microsoft.Data.Services.Client dll)时,似乎在新版本的WCF数据服务中插入了一些缓存机制

因为当我们通过浏览器查询数据服务(OData)时,会返回新的数据,但当我们向UI项目添加服务引用并使用该引用(代理)检索数据时,只有在大约10分钟后才会显示新的数据

通过重置IIS(iisreset.exe),可以获得新的数据,这可能意味着UI项目中的某个地方应该有缓存

我们在代码中没有做什么特别的事情,但在最简单的状态下使用OData服务引用:

public List<Customer> GetCustomers()
{
    CustomersODataModel customersData = new CustomersODataModel("Url");
    return customersData.ToList();
}
public List GetCustomers()
{
CustomerSodatModel CustomerData=新CustomerSodatModel(“Url”);
返回customersData.ToList();
}

考虑在DataService对象中禁用客户端缓存,看看这是否有帮助。我也遇到了同样的问题,将dataService.MergeOption设置为MergeOption=MergeOption.OverwriteChanges有助于数据服务在每次更改和获取时刷新obejct