From 19d53cb33b40c2d4fe0690d40c75ca495f86fb0e Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Mon, 26 Jun 2017 21:02:33 +0100 Subject: [PATCH] relocate IDbProvider and SatelliteLog classes to interfaces. --- RaceLapTimer/{RaceLapTimer => Interfaces}/IDbProvider.cs | 2 +- RaceLapTimer/Interfaces/Interfaces.csproj | 2 ++ RaceLapTimer/Interfaces/SatelliteLog.cs | 8 ++++++++ .../RaceLapTimer/ApiControllers/SatelliteApiModule.cs | 9 ++------- 4 files changed, 13 insertions(+), 8 deletions(-) rename RaceLapTimer/{RaceLapTimer => Interfaces}/IDbProvider.cs (91%) create mode 100644 RaceLapTimer/Interfaces/SatelliteLog.cs diff --git a/RaceLapTimer/RaceLapTimer/IDbProvider.cs b/RaceLapTimer/Interfaces/IDbProvider.cs similarity index 91% rename from RaceLapTimer/RaceLapTimer/IDbProvider.cs rename to RaceLapTimer/Interfaces/IDbProvider.cs index 9e7cf26..3c0f9ba 100644 --- a/RaceLapTimer/RaceLapTimer/IDbProvider.cs +++ b/RaceLapTimer/Interfaces/IDbProvider.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using Interfaces; -using RaceLapTimer.ApiControllers; namespace RaceLapTimer { @@ -27,5 +26,6 @@ namespace RaceLapTimer void StoreTransponderLog(SatelliteLog log); bool DeletePilot(int id); + bool RemoveTransponderAssociation(int pilotId); } } \ No newline at end of file diff --git a/RaceLapTimer/Interfaces/Interfaces.csproj b/RaceLapTimer/Interfaces/Interfaces.csproj index 3ff7cbe..c8ac22f 100644 --- a/RaceLapTimer/Interfaces/Interfaces.csproj +++ b/RaceLapTimer/Interfaces/Interfaces.csproj @@ -42,6 +42,7 @@ + @@ -64,6 +65,7 @@ + diff --git a/RaceLapTimer/Interfaces/SatelliteLog.cs b/RaceLapTimer/Interfaces/SatelliteLog.cs new file mode 100644 index 0000000..7c435f8 --- /dev/null +++ b/RaceLapTimer/Interfaces/SatelliteLog.cs @@ -0,0 +1,8 @@ +namespace Interfaces +{ + public class SatelliteLog + { + public int TransponderToken { get; set; } + public int LapTimeMs { get; set; } + } +} \ No newline at end of file diff --git a/RaceLapTimer/RaceLapTimer/ApiControllers/SatelliteApiModule.cs b/RaceLapTimer/RaceLapTimer/ApiControllers/SatelliteApiModule.cs index 8f70c77..f9a26b4 100644 --- a/RaceLapTimer/RaceLapTimer/ApiControllers/SatelliteApiModule.cs +++ b/RaceLapTimer/RaceLapTimer/ApiControllers/SatelliteApiModule.cs @@ -1,11 +1,12 @@ using System; +using Interfaces; using Nancy; namespace RaceLapTimer.ApiControllers { public class SatelliteApiModule:NancyModule { - private IDbProvider _provider; + private readonly IDbProvider _provider; public SatelliteApiModule(IDbProvider provider) : base("/api/satellite") { _provider = provider; @@ -26,10 +27,4 @@ namespace RaceLapTimer.ApiControllers return HttpStatusCode.OK; } } - - public class SatelliteLog - { - public int TransponderToken { get; set; } - public int LapTimeMs { get; set; } - } }