drop down menu - LINQ Union with Constant Values -
The very old question, but I'm stuck (I think that is likely to novice) is. I have a function that wants to send me a list of companies: Also, I want to be able to specify a top element to the drop-down list to the caller .. ( "Say No") have A piece of code, how do I add the top element with the return list to return?
list public static selection GetCompanies (bool only accepted, FCCIEntityDataContext EntityDataContext, SelectListItem TopElement) {var cs EntityDataContext.Comporates by = c where (c. Approved == only accepted || only accepted == Incorrect) choose New {c.Id, c.Company}; Return to the new schedule (cs.AsEnumerable (), "id", "compene"); }
Thanks!
This should work for you:
List & lt; Corporate & gt; Corporates = (in Detatontekst unit. Corporates where (c. Approved == only acceptable || only accepted == false) c) Ksuchisuchi (); Companies Add (new corporate {id = -1, company = "none"}); New Selection List Return (Corporate. Aanumerebl (), "id", "Comepeni");
Comments
Post a Comment