diff --git a/Iot/Entities/ActorType.cs b/Iot/Entities/ActorType.cs index 3fb3dfe..2b173c0 100644 --- a/Iot/Entities/ActorType.cs +++ b/Iot/Entities/ActorType.cs @@ -7,6 +7,5 @@ public class ActorType public int Id { get; set; } public string Name { get; set; } - // Navigation Property public List Actors { get; set; } = new List(); } \ No newline at end of file diff --git a/Iot/Entities/Measurement.cs b/Iot/Entities/Measurement.cs index 61af6cd..a81d962 100644 --- a/Iot/Entities/Measurement.cs +++ b/Iot/Entities/Measurement.cs @@ -1,4 +1,4 @@ -namespace Iot.Entities; +namespace Iot.Entities; using System; @@ -10,7 +10,6 @@ public class Measurement public int MeasurementTypeId { get; set; } public double Value { get; set; } - // Navigation Properties public Actor Actor { get; set; } public MeasurementType MeasurementType { get; set; } } \ No newline at end of file diff --git a/Iot/Entities/MeasurementType.cs b/Iot/Entities/MeasurementType.cs index a8c1b93..cad8e64 100644 --- a/Iot/Entities/MeasurementType.cs +++ b/Iot/Entities/MeasurementType.cs @@ -1,4 +1,4 @@ -namespace Iot.Entities; +namespace Iot.Entities; using System.Collections.Generic; @@ -8,6 +8,5 @@ public class MeasurementType public string Name { get; set; } public string Comment { get; set; } - // Navigation Property public List Measurements { get; set; } = new List(); } \ No newline at end of file diff --git a/Iot/Program.cs b/Iot/Program.cs index 05bd201..c2e1332 100644 --- a/Iot/Program.cs +++ b/Iot/Program.cs @@ -1,7 +1,7 @@ -/*-------------------------------------------------------------- -* HTBLA-Leonding / Class: 1xHIF +/*-------------------------------------------------------------- +* HTBLA-Leonding / Class: 4CHIF *-------------------------------------------------------------- -* Musterlösung-HA +* Musterlösung-Hinterdorfer Jonas *-------------------------------------------------------------- * Description: Iot *-------------------------------------------------------------- @@ -98,22 +98,18 @@ var measurements = measurementsCsv.Select(m => }; }).ToList(); - -// Populate Actor.Measurements using ToLookup (O(n) instead of O(n*m)) var measurementsByActor = measurements.ToLookup(m => m.ActorId); foreach (var actor in actors) { actor.Measurements = measurementsByActor[actor.Id].ToList(); } -// Populate MeasurementType.Measurements using ToLookup (O(n) instead of O(n*m)) var measurementsByType = measurements.ToLookup(m => m.MeasurementTypeId); foreach (var measurementType in measurementTypes) { measurementType.Measurements = measurementsByType[measurementType.Id].ToList(); } -// Populate ActorType.Actors using ToLookup (O(n) instead of O(n*m)) var actorsByType = actors.ToLookup(a => a.ActorTypeId); foreach (var actorType in actorTypes.Values) { diff --git a/flake.nix b/flake.nix index a11d11d..c2f591e 100644 --- a/flake.nix +++ b/flake.nix @@ -16,8 +16,6 @@ devShells.default = pkgs.mkShell { packages = [ pkgs.dotnet-sdk_9 - # alternativ/zusätzlich: - # pkgs.dotnetCorePackages.sdk_9_0 ]; }; });