Skip to content

Instantly share code, notes, and snippets.

View dstarr's full-sized avatar
💭
Learning starts here

David Starr dstarr

💭
Learning starts here
View GitHub Profile
@dstarr
dstarr / ActionMethod.cs
Created November 25, 2022 20:02
IServiceProvider Constructor injection
public ActionResult Index(string[] array)
{
int[] result = [0];
using (var scope = _serviceProvider.CreateScope())
{
var service = scope.GetService<IArrayReversalService>();
result = await service.Reverse(array);
}