From d7b0f2246dff67024fbbc6495ef449ef54bc2b22 Mon Sep 17 00:00:00 2001 From: Martin Klingenberg Date: Fri, 18 Oct 2024 09:17:57 +0200 Subject: [PATCH 1/2] Updates to the interview task Lets make the task better for the candidates - Added CORS, to save the candidate some time - Added another endpoint to have an even better starting point where there are examples for query parameters and some more linq expressions in the code --- .../Interfaces/IParkingStore.cs | 4 +- src/Alv.Parkering.Host/Alv.Parkering.csproj | 47 ++++++++---------- src/Alv.Parkering.Host/ClientApp/src/App.tsx | 2 - .../Controllers/ParkingSpotController.cs | 12 ++++- src/Alv.Parkering.Host/Program.cs | 13 +++++ src/Alv.Parkering.Host/parkering.sqlite | Bin 0 -> 8216576 bytes .../Repositories/ParkingSpotRepository.cs | 43 +++++++++++++--- 7 files changed, 84 insertions(+), 37 deletions(-) create mode 100644 src/Alv.Parkering.Host/parkering.sqlite diff --git a/src/Alv.Parkering.Application/Interfaces/IParkingStore.cs b/src/Alv.Parkering.Application/Interfaces/IParkingStore.cs index 900e760..37a59c4 100644 --- a/src/Alv.Parkering.Application/Interfaces/IParkingStore.cs +++ b/src/Alv.Parkering.Application/Interfaces/IParkingStore.cs @@ -2,6 +2,8 @@ namespace Alv.Parkering.Application.Interfaces; -public interface IParkingStore { +public interface IParkingStore +{ Task> FetchParkingSpots(int page, int pageSize); + Task> FetchAllParkingSpots(); } diff --git a/src/Alv.Parkering.Host/Alv.Parkering.csproj b/src/Alv.Parkering.Host/Alv.Parkering.csproj index d4f1370..d609400 100644 --- a/src/Alv.Parkering.Host/Alv.Parkering.csproj +++ b/src/Alv.Parkering.Host/Alv.Parkering.csproj @@ -12,53 +12,50 @@ npm start enable - - + - - - - + + + - - - + + - - - - + + + + + + + PreserveNewest + - - + - - - + + + - - - - + + - - + + wwwroot\%(RecursiveDir)%(FileName)%(Extension) PreserveNewest true - diff --git a/src/Alv.Parkering.Host/ClientApp/src/App.tsx b/src/Alv.Parkering.Host/ClientApp/src/App.tsx index 35ceeea..f80145a 100644 --- a/src/Alv.Parkering.Host/ClientApp/src/App.tsx +++ b/src/Alv.Parkering.Host/ClientApp/src/App.tsx @@ -12,8 +12,6 @@ function App() {

Legg til kode her