public static List <City> GetCity() { List <tblCity> city = dropDownRepository.GetCity(); List <City> list = new List <City>(); foreach (var item in city) { City cityobj = new City() { CityID = item.CityID, CityName = item.CityName }; if (item.IsDeleted) { } else { list.Add(cityobj); } } return(list); }