From 5c28f84ea6fc76cdd42ddc66442e5bc51a930f9d Mon Sep 17 00:00:00 2001 From: Ashraful Haque Date: Tue, 23 Feb 2021 15:19:04 +0000 Subject: [PATCH] updated values controller --- Controllers/ValuesController.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Controllers/ValuesController.cs b/Controllers/ValuesController.cs index c4287c5..8d0ae16 100644 --- a/Controllers/ValuesController.cs +++ b/Controllers/ValuesController.cs @@ -22,5 +22,19 @@ namespace TestApplication.Controllers { return await _context.Values.ToListAsync(); } + + [HttpGet("{id}")] + public async Task> GetValues_ById(int id) + { + var values = await _context.Values.FindAsync(id); + if(values != null) + { + return values; + } + else + { + return NotFound(); + } + } } } \ No newline at end of file