namespace StrategyPattern.Controllers { public class EventController : ApiController { readonly IEventRepository _eventRepository; //NInject swaps IEventRepository with FakeEventRepository public EventController(IEventRepository eventRepository) { this._eventRepository = eventRepository; } // GET: api/Event?customerID=1 - pretend each customer, at the time of registration, only has one customer type based on who it is (a school, a non-profit, a student, or a general user). public IEnumerable Get(int customerID) { //Get the upcoming events, applying any discounts the customer might receive. There are several ways to do this, but I chose to pass the ID as a parameter. return _eventRepository.GetEvents(UserService.GetCustomerTypeFromID(customerID)); } } }