public List<Location> GetAllLocation() { List<Location> locList = new List<Location>(); try { CycleCount objCycleCount = new CycleCount(); DataTable dtLoc = objCycleCount.GetAllLocation(); foreach (DataRow drLoc in dtLoc.Rows) { Location objloc = new Location(); objloc.LocationID = Convert.ToInt32(drLoc["LocationID"]); objloc.DisplayName = drLoc["LocationName"].ToString(); locList.Add(objloc); } } catch (Exception ex) { _log.Error("Error:GetAllLocation:: " + ex.Message + Environment.NewLine + ex.StackTrace); ThrowFaultError(ex.Message, 200); } return locList; }