Skip to content

Commit 934ffb5

Browse files
committed
logger added
logger added, deprecated api version added
1 parent 299e1b1 commit 934ffb5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Supermarket/V1/Controllers/AboutController.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.Extensions.Logging;
23

34
namespace Supermarket.V1.Controller
45
{
56
[ApiController]
6-
[ApiVersion("1.0")]
7+
[ApiVersion("1.0", Deprecated = true)]
78
[Route("api/v{version:apiVersion}/[controller]")]
89
public class AboutController : ControllerBase
910
{
11+
private readonly ILogger<AboutController> _logger;
12+
13+
public AboutController(ILogger<AboutController> logger)
14+
{
15+
_logger = logger;
16+
}
17+
1018
[HttpGet]
1119
public IActionResult Get()
1220
{
21+
_logger.LogInformation("Still consuming deprecated api method");
22+
1323
return Ok(new { message = "This is about Api Version 1.0" });
1424
}
1525
}

0 commit comments

Comments
 (0)