var usrModel = new UserRegisterModel(); Country curid = snwe.Countries.Where(a => a.Country1 == "India").FirstOrDefault(); usrModel.Countries = snwe.Countries.AsEnumerable().Select(C => new SelectListItem { Text = C.Country1, Value = SqlFunctions.StringConvert((double)C.CountryID).Trim(), Selected = C.CountryID == curid.CountryID ? true : false });
snwe.Countries.Select(...
Value = C.CountryID.ToString().Trim(),
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)