From 6f98822c904eb5bc849c88e27b773209456f02d7 Mon Sep 17 00:00:00 2001 From: thom776g Date: Thu, 7 Dec 2023 09:21:20 +0100 Subject: [PATCH] dotnet format --- CentralHub.Api/Services/SampleRoomRepository.cs | 4 ++-- CentralHub.Api/Services/SampleTrackerRepository.cs | 6 +++--- CentralHub.WebUI/Data/TrackerService.cs | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CentralHub.Api/Services/SampleRoomRepository.cs b/CentralHub.Api/Services/SampleRoomRepository.cs index a12cc0f..3d94d10 100644 --- a/CentralHub.Api/Services/SampleRoomRepository.cs +++ b/CentralHub.Api/Services/SampleRoomRepository.cs @@ -19,7 +19,7 @@ static SampleRoomRepository() var sampleRoomRepository = new SampleRoomRepository(); List rooms = new List(); - for(int i = 0; i < 5; i++) + for (int i = 0; i < 5; i++) { rooms.Add(new RoomDto() { @@ -30,7 +30,7 @@ static SampleRoomRepository() }); } - foreach(var room in rooms) + foreach (var room in rooms) { sampleRoomRepository.AddRoomAsync(room, default).GetAwaiter().GetResult(); } diff --git a/CentralHub.Api/Services/SampleTrackerRepository.cs b/CentralHub.Api/Services/SampleTrackerRepository.cs index 8f7f96d..70dafb5 100644 --- a/CentralHub.Api/Services/SampleTrackerRepository.cs +++ b/CentralHub.Api/Services/SampleTrackerRepository.cs @@ -53,8 +53,8 @@ static SampleTrackerRepository() BluetoothMacAddress = BluetoothName, Name = $"Sample Tracker {i}", Description = "Sample Tracker", - RoomDtoId = rooms[i%1].RoomDtoId, - RoomDto = rooms[i%1], + RoomDtoId = rooms[i % 1].RoomDtoId, + RoomDto = rooms[i % 1], TrackerDtoId = -1, }); } @@ -65,7 +65,7 @@ static SampleTrackerRepository() sampleTrackerRepository.AddTrackerAsync(tracker, default).GetAwaiter().GetResult(); } - for(int i = 0; i < 5; i++) + for (int i = 0; i < 5; i++) { String WifiName; String BluetoothName; diff --git a/CentralHub.WebUI/Data/TrackerService.cs b/CentralHub.WebUI/Data/TrackerService.cs index 0a11ec8..f876fa0 100644 --- a/CentralHub.WebUI/Data/TrackerService.cs +++ b/CentralHub.WebUI/Data/TrackerService.cs @@ -20,7 +20,7 @@ public TrackerService(IHttpClientFactory clientFactory) { _clientFactory = clientFactory; } - + public async Task RemoveTrackerAsync(Tracker tracker, CancellationToken cancellationToken) { var request = new HttpRequestMessage( @@ -38,7 +38,7 @@ public async Task RemoveTrackerAsync(Tracker tracker, CancellationToken cancella throw new InvalidOperationException("Somethings fucky"); } } - + public async Task AddTrackerAsync(Room room, UnregisteredTracker tracker, String name, String description, CancellationToken cancellationToken) { var addTrackerRequest = new AddTrackerRequest(room.RoomId, name, description, tracker.WifiMacAddress, tracker.BluetoothMacAddress); @@ -81,7 +81,8 @@ public async Task UpdateTrackerAsync(Room room, Tracker tracker, String name, St { throw new InvalidOperationException("Somethings fucky"); } - } else + } + else { await RemoveTrackerAsync(tracker, cancellationToken); UnregisteredTracker[] uTrackers = await GetUnregisteredTrackersAsync(cancellationToken);