From 89b30c1bb4a10868e8a92333d3b7f79e98b0b02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Bigaj?= <4rafalbigaj@gmail.com> Date: Wed, 28 Aug 2024 17:01:27 +0200 Subject: [PATCH] Update README.md Two changes were made: 1. Removed string interpolation from error message (it was not needed). 2. Removed argument passed to mathod GetThingFromDb(...). --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index beea4b1..4527357 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ public IActionResult Register(string username) return createUserResult.Match( user => new RedirectResult("/dashboard"), invalidName => { - ModelState.AddModelError(nameof(username), $"Sorry, that is not a valid username."); + ModelState.AddModelError(nameof(username), "Sorry, that is not a valid username."); return View("Register"); }, nameTaken => { @@ -120,7 +120,7 @@ The return value indicates if the OneOf contains a T𝑥 or not. If so, then `va ```csharp IActionResult Get(string id) { - OneOf thingOrNotFoundOrError = GetThingFromDb(string id); + OneOf thingOrNotFoundOrError = GetThingFromDb(id); if (thingOrNotFoundOrError.TryPickT1(out NotFound notFound, out var thingOrError)) //thingOrError is a OneOf return StatusCode(404);