move the ClusterData class to the Models

This commit is contained in:
Andreas Zweili 2018-08-07 22:42:04 +02:00
parent e88a1ae1fd
commit e87b37e42c
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
using System.Collections.Generic;
using Server.DB;
using System.Linq;
namespace Server.Models
{
@ -13,13 +14,16 @@ namespace Server.Models
Context ctx = new Context();
this.Patients = new List<Person>();
this.FoodPlaces = new List<FoodPlace>();
List <FoodPlace> RawFoodPlaces = new List<FoodPlace>();
PatientAtFoodPlaceDB relationsDB = new PatientAtFoodPlaceDB();
this.Relations = new List<PatientAtFoodPlace>(relationsDB.GetAllRelations());
foreach (var relation in this.Relations)
{
this.Patients.Add(relation.Patient);
this.FoodPlaces.Add(relation.FoodPlace);
RawFoodPlaces.Add(relation.FoodPlace);
}
var unique_foodplaces = new HashSet<FoodPlace>(RawFoodPlaces);
this.FoodPlaces = unique_foodplaces.ToList();
}
public List<Node> GenerateNodes()
{

View File

@ -119,7 +119,7 @@
</Compile>
<Compile Include="IService.cs" />
<Compile Include="Models\City.cs" />
<Compile Include="Helper\ClusterData.cs" />
<Compile Include="Models\ClusterData.cs" />
<Compile Include="Models\Country.cs" />
<Compile Include="Models\Doctor.cs" />
<Compile Include="Models\Edge.cs" />