I write this code in C# with LINQ. Type of innerResult2 is IEnumerable<out T>
this part of code has exception :
Nullable object must have a value
var innerResult2 = (from Vw_WorkFlow_Cartable in innerResult
select new
{
isedit = (bool?)Convert.ToBoolean((
(from v in view8.Table.AsEnumerable()
where
v.Field<bool?>("SendByRequester") == true
select new
{
ActivityID = v.Field<Guid>("ActivityID")
})
.Contains(new
{
ActivityID = (System.Guid)Vw_WorkFlow_Cartable.Field<Guid?>("ActivityID")
})
? true : false))
})
"ActivityId"null? You cast from nullable (Guid?) to non-nullable (Guid) type, if it's null then it will give you error.(from ...where... select new {...}).Contains(new {...})this code should never work, what is the comparer? and why are you trying toConvert.ToBoolean(bool boolValue)?Contains(...) ? true: falseis another redundant.