ensure that the node id are unique in the cluster

This commit is contained in:
Andreas Zweili 2018-07-29 14:12:57 +02:00
parent 715d581c8a
commit c71ec890ca
3 changed files with 7 additions and 7 deletions

View File

@ -28,7 +28,7 @@ namespace Server.Models
{
Node node = new Node
{
id = patient.PersonID,
id = patient.PersonID + patient.FirstName,
label = patient.FirstName + " " + patient.LastName,
};
Nodes.Add(node);
@ -38,7 +38,7 @@ namespace Server.Models
{
Node node = new Node
{
id = foodplace.FoodPlaceID,
id = foodplace.FoodPlaceID + foodplace.Name,
label = foodplace.Name + ", " + foodplace.City.Name + ", " + foodplace.City.Country.Name,
};
Nodes.Add(node);
@ -53,8 +53,8 @@ namespace Server.Models
{
Edge edge = new Edge
{
from = relation.FoodPlaceID,
to = relation.PatientID
from = relation.FoodPlaceID + relation.FoodPlace.Name,
to = relation.PatientID + relation.Patient.FirstName
};
Edges.Add(edge);
}

View File

@ -7,7 +7,7 @@ namespace Server.Models
{
public class Edge
{
public int from { get; set; }
public int to { get; set; }
public string from { get; set; }
public string to { get; set; }
}
}

View File

@ -7,7 +7,7 @@ namespace Server.Models
{
public class Node
{
public int id { get; set; }
public string id { get; set; }
public string label { get; set; }
public int cid { get; set; }
}