I have a select query with Linq like this:
string _mycondition = "0";
DataClasses1DataContext m = new DataClasses1DataContext();
var q = from p in m.ViewPersonCarRelations.AsEnumerable()
select new
{
FirstName = p.name,
LastName = p.Lname
};
I want to select my columns with a condition , for example : only if _mycondition == "0" is true , select p.name and name it FirstName otherwise my variable should not has FirstName . I was wonder, is it possible to do that with Linq ?