Option Strict On disallows implicit conversions from 'Boolean?' to 'Boolean'

Is there something wrong with this expression?

image

@Luis_Fernando

Just to check can you try .Equals(0)

Cheers

same :frowning:

we can replicate by involving a nullable boolean variable:
grafik

And can explore the value access options and check
grafik

Within a small snippet we can provoke the issue
grafik

And rewrite to:
grafik

Hi @Luis_Fernando

Could you give a try the below one,

If(list_itemsComanda.data.Where(Function(X) X.session = ent_DataosApoyo.sesion).Count=0,True,False)

Hope it helps!!

The VB .Where method can only take in Boolean as a predicate. Since x.sesion = ent_DatosApoyo.sesion evaluates to data of type Nullable Boolean, you need to get the Boolean value of the expression with the following (x.sesion = ent_DatosApoyo.sesion).Value.

Hi thank you for the attention

I tried this and it does not work

what was done in detail? What is failling?

Hello @eaghuang

Great! this did work, Thank you very much!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.