If I have a service, IService, that needs to access the Request or Response objects given by ControllerBase like I would in a controller:
[HttpGet]
public async Task<IActionResult> HelloWorldAsync() {
Response.Cookies.Append("Hello World", "Goodbye World");
return Ok();
}
How would I access Response from within a service? What would I need to inject? Or do I need to resort to passing it through the method of the service, like so:
[HttpGet]
public async Task<IActionResult> HelloWorldAsync() {
await _myService.FooWithCookies(Response);
return Ok();
}