How to set selected true from contains list string in linq ???
I want to set selected true if some field is same from variabel list string. this is my code for my case.
string detail = Request.QueryString["detail"];
List<string> KdUser = new List<string>();
if (detail != null) {
KdUser = (from u in db.TUserSelecteds where u.detail_guid_edis == new Guid(detail) select u.kode_user).ToList();
}
// KdUser = [0]U002,[1]U001,[2]U003
List<SelectListItem> items = (from us in db.Users
where us.ApplicationId == "TMS-APP-03" && us.IsActive == 1
orderby us.NamaKaryawan
select new SelectListItem()
{
Text = us.NamaKaryawan,
Value = us.KodeUser
//Selected = true => If (Value Contains KdUser)
}).ToList();
I hope you understand what i mean. thanks