Oct 02 2023
[HttpGet]
public IActionResult Get([FromRoute] string id)
{
int[] intId = _hashids.Decode(id);
if (intId.Length == 0) return NotFound();
User user = _userService.GetUser(intId[0]);
if (user is null) return NotFound();
return Ok(user);
}
private List<User> Users = new List<User>
{
new User { Id = 1, FullName = "Stefan Djokic" },
new User { Id = 2, FullName = "Ricky Sellers"},
new User { Id = 3, FullName = "Tasnim Shaffer"}
};
Join 13,250+ subscribers to improve your .NET Knowledge.
Go-to resource for understanding the core concepts of design patterns without the overwhelming complexity. In this concise and affordable ebook, I've distilled the essence of design patterns into an easy-to-digest format. It is a Beginner level. Check out it here.
Every Monday morning, I share 1 actionable tip on C#, .NET & Arcitecture topic, that you can use right away.
Subscribe to the TheCodeMan.net and be among the 13,250+ subscribers gaining practical tips and resources to enhance your .NET expertise.