Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
34 lines (29 sloc) 1.06 KB
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace AsyncLocal.SimpleInjector.Web.Controllers
public class CustomerController : Controller
private readonly ICustomerService _customerService;
private readonly CorrelationContainer _correlationContainer;
public CustomerController(ICustomerService customerService, CorrelationContainer correlationContainer)
_customerService = customerService;
_correlationContainer = correlationContainer;
public async Task<Customer> Get(int id)
// Set async local correlation id.
var correlationId = Guid.NewGuid();
// Call controller dependency (decorated by LoggingDecorator).
var customer = await _customerService.GetCustomer(id);
// Return values.
return customer;