【发布时间】:2010-05-19 16:02:24
【问题描述】:
我刚刚创建的 WCF 服务有问题。这是昨天的工作,但由于某种原因它刚刚停止工作。
我的一个 WCF 方法返回一个 Entity Framework 实体的数组,如下所示:
public BranchContactDetail[] GetClosestBranches(string postcode, int howManyBranches)
{
GeoLocation geoLocation = GetLocationFromPostcode(postcode);
Location location = new Location(geoLocation.Latitude, geoLocation.Longitude);
using (BranchDirectoryEntities entities = new BranchDirectoryEntities())
{
var branchesInOrder = entities.BranchContactDetails
.Where(b => b.latitude.HasValue && b.longitude.HasValue )
.OrderBy(b => location.DistanceFrom(b.latitude, b.longitude))
.Take(howManyBranches)
.ToArray();
return branchesInOrder;
}
}
...而且,正如我所说,昨天运行良好。现在我收到“底层连接已关闭:连接意外关闭”。我在网上搜索过,但似乎没有人知道答案。有人对这个问题有所了解吗?
问候,马克
【问题讨论】:
标签: wcf exception entity-framework-4