Hi
I have a problem with a WCF Service I've just created. This was working yesterday but for some reason it's just stopped working.
One of my WCF methods returns an array of an Entity Framework entity, like this:
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;
}
}
...and, as I say, this was working fine yesterday. Now I'm getting a "The underlying connection was closed: The connection was closed unexpectedly." I've hunted all over the web but no-one seems to know the answer. Anyone shed any light on this issue?
Regards, Mark