ok so this is maybe very simple but I just can not see where I am going wrong so any help is grateful
I have a model of this:
public IEnumerable<SelectedProfiels> profiles { get; set; }
public class SelectedProfiels
{
public int Identifer { get; set; }
public string ProfileName { get; set; }
}
and then I am trying to read from this
i am then building an array called selectedProfiles
,
I then have this code
var pro = from s in selectedProfiles select s;
What im wanting to do is find all the ProfileName
's and assigned them there on ViewBag.[i]
or just there own string variable
I have a model collection like this
var userd = new User()
{
ID = i.FirstOrDefault(),
Type = t.FirstOrDefault(),
AuthorityLevel = a.FirstOrDefault(),
Language = l.FirstOrDefault(),
Profiles = pro,
};
public IEnumerable<SelectedProfiels> profiles { get; set; }
public class SelectedProfiels
{
public int Identifer { get; set; }
public string ProfileName { get; set; }
}
I then pass userd to a new page:
return RedirectToAction("test", "Account", userd);
public ActionResult test (Userm)
{
ViewBag.d = m.profiles;
return View();
}
any help please