public static PostcodeAreaController GetInitialisedPostcodeAreaController(IPostcodeAreaService postcodeAreaService) { var controller = new PostcodeAreaController(postcodeAreaService) { Request = new HttpRequestMessage { RequestUri = new Uri(Url) }, Configuration = new HttpConfiguration() }; controller.Configuration.MapHttpAttributeRoutes(); controller.Configuration.EnsureInitialized(); return controller; }
public PostcodeAreaController(IPostcodeAreaService postcodeAreaService) { Check.If(postcodeAreaService).IsNotNull(); _postcodeAreaService = postcodeAreaService; }