This is a follow up question from here: linq issue with creating relationships in regards to the answer I recieved. Im not sure what has happend but I get an error:
The underlying connection was closed: An unexpected error occurred on a receive.
And this is where the exception happens:
string uriGroup = "http://localhost:8000/Service/Group";
private void ListGroups_Click(object sender, RoutedEventArgs e)
{
XDocument xDoc = XDocument.Load(uriGroup); // this line
var groups = xDoc.Descendants("Group")
.Select(n => new
{
GroupName = n.Element("GroupName").Value,
GroupHeader = n.Element("GroupHeader").Value,
TimeCreated = DateTime.Parse(n.Element("TimeAdded").Value),
Tags = n.Element("Tags").Value,
Messages = n.Element("GroupMessages").Value
})
.ToList();
dataGrid2.ItemsSource = groups;
}