diff --git a/README.md b/README.md index 621713d..42b6529 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ This exercise is designed to test your skills in C# and .NET. * Minimal ASP.NET Core Web API * Entity Framework Core * SQLite3 Database (simplified for portability) -* HttpClient for downstream REST API calls +* `HttpClient` for downstream REST API calls * ??? ## Prerequisites * Latest [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) -* Visual Studio Code -* Docker Desktop and docker compose plugin +* Visual Studio Code with C# Dev Kit extension + * Also works with Visual Studio 2022 and JetBrains Rider. * **Disable Copilot completions** (that would make it too easy...) * Be ready for sharing your screen in Zoom * Launch settings have been configured to run and debug the web application diff --git a/service/JsonPlaceholderClient.cs b/service/JsonPlaceholderClient.cs index 5f6fda0..8fcbe7f 100644 --- a/service/JsonPlaceholderClient.cs +++ b/service/JsonPlaceholderClient.cs @@ -16,7 +16,7 @@ public class JsonPlaceholderClient // TODO: Configure the client as needed. } - public async Task GetPostByIdAsync(int id, CancellationToken ct = default) + public async Task GetPostByIdAsync(int id, CancellationToken ct = default) { // TODO: Implement the logic to call the external service and retrieve the post by ID. throw new NotImplementedException("This method will be implemented in Phase 1."); diff --git a/service/PostModel.cs b/service/PostDto.cs similarity index 89% rename from service/PostModel.cs rename to service/PostDto.cs index b90061f..88558d3 100644 --- a/service/PostModel.cs +++ b/service/PostDto.cs @@ -3,7 +3,7 @@ using System; namespace service; [Serializable] -public class PostModel +public class PostDto { public int Id { get; set; } public int UserId { get; set; } diff --git a/service/Program.cs b/service/Program.cs index 9d89c75..1b2cd20 100644 --- a/service/Program.cs +++ b/service/Program.cs @@ -35,7 +35,7 @@ app.UseRequestTimeouts(); app.MapGet("/posts/{id}", async (AppDbContext dbContext, JsonPlaceholderClient client, int id) => { // TODO: (Phase 1) Implement the logic to retrieve a post by ID and store it in the database. - // Consider some minimal error handling in case the post is not found (e.g. Id > 100). + // Consider some minimal error handling in case the post is not found (e.g. when testing with an Id > 100). return Results.Ok(); }) .WithRequestTimeout(TimeSpan.FromSeconds(29))