/// <summary> /// Gets all. /// </summary> /// <param name="codeTableType">Type of the code table.</param> /// <returns></returns> /// <exception cref="System.Exception">Unknown CodeTableType: + codeTableType</exception> public List <CodeTableItem> GetAll(CodeTableType codeTableType) { List <CodeTableItem> list = new List <CodeTableItem>(); switch (codeTableType) { case CodeTableType.VehicleType: list = ServiceLocator.Instance.Resolve <IVehicleTypeRepository>().GetAll(); break; case CodeTableType.EngineType: list = ServiceLocator.Instance.Resolve <IEngineTypeRepository>().GetAll(); break; case CodeTableType.EuroExhaustType: list = ServiceLocator.Instance.Resolve <IEuroExhaustTypeRepository>().GetAll(); break; case CodeTableType.FuelType: list = ServiceLocator.Instance.Resolve <IFuelTypeRepository>().GetAll(); break; default: throw new Exception("Unknown CodeTableType: " + codeTableType); } return(list); }
/// <summary> /// Gets the specified code table type. /// </summary> /// <param name="codeTableType">Type of the code table.</param> /// <returns></returns> public List <CodeTableItem> Get([FromUri] CodeTableType codeTableType) { return(_codeTableManager.GetAll(codeTableType)); }