I do have an existing rest api project developed using asp.net core 3.1. At present we are planning to do code refactoring and optimize it. I came across BenchMarkDotNet (https://benchmarkdotnet.org/) recently. All the examples that I have come across are mostly targeted for console based applications. I wanted to leverage this in case of rest apis project too, but did not came across any reference examples in context to its usage.
Code:
[Route("api/[Action]")] [ApiController] [AllowModule(AppType = ApplicationType.Testing)] public class TestController : BaseController { private readonly ITestService _testService; public TestController(ITestService testService, ILogger logger) : base(logger) { _testService = testService ?? throw new ArgumentNullException(nameof(testService)); }
[HttpGet("{inspectionID:long}", Name = "GetDetails")]
[ResponseCache(CacheProfileName = "Never")]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
public async Task<IEnumerable<TestDTO>> Get(long inspectionID) => await _testService.GetDetails(inspectionID);
}
Can anyone help me here by providing their guidance?