lundi 31 octobre 2016

LINQ to SQL: if statement in select

in c# i want to return IEnumerable with column with name isedit

my type of innerResult is IEnumerable

but i have error Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.IEnumerable'. An explicit conversion exists (are you missing a cast?)

 innerResult = (from f in innerResult

                                   select new
                                   {

                                      isedit =  (bool?)Convert.ToBoolean(((APS_WorkFlow_Activities).Contains(f.Field<Guid>("ActivityID")) ? false : true))
                                   });

Aucun commentaire:

Enregistrer un commentaire