public List <FuelVM> GetFuelTypes() { using (var db = new Lead2OrderGenerateDbEntities()) { List <l2g_tbl_Fuel> fuelTypes = db.l2g_tbl_Fuel.ToList(); if (fuelTypes.Count > 0) { List <FuelVM> fuelVMs = new List <FuelVM>(); foreach (var fuelType in fuelTypes) { fuelVMs.Add(MappingConfig.FuelToBusinessEntity(fuelType)); } return(fuelVMs); } return(new List <FuelVM>()); } }