2
Answers

Only last record is added in the List

 List<LocationInfornationLocation> locatonsList = new List<LocationInfornationLocation>();
            foreach (var item in businessEntityList)
            {
                lcoationInfo.LocationName = item.LocationDetails.LocationName.ToString() + "_" + item.LocationDetails.LocationId;
                lcoationInfo.BusinessEntityId =Convert.ToUInt16(item.ID);
                locatonsList.Add(lcoationInfo);
            }
            return locatonsList;

Hi I am getting 3 records from the database but when I do the above looping only 3rd record is displayed in place of 3 records .Can any one solve this please. 
Answers (2)