Lambda problem

  • Thread starter Thread starter Markus Freitag
  • Start date Start date
M

Markus Freitag

Guest
Hello,
I want to create a property.
ReleaseOfUpperListGiven()
The function works as expected.
The question is, can I write the shorter one?

bool ret = ListTop?.Count == 0 ? false : true;

If ListTop is null, false should be returned, this does not make it right.

Could I write the function right after the Lamda expression. If so, how?
IsReleaseOfUpperListGiven
What is the default setting when I use lambda? True or false?

Thanks in advance.
[XmlIgnore]
public bool IsReleaseOfUpperListGiven => ReleaseOfUpperListGiven()

bool ReleaseOfUpperListGiven()
{
bool ret = false;

if ( ListTop!= null )
ret = ListTop.Count == 0 ? false : true;

return ret;
}

Greetings Markus

Continue reading...
 
Back
Top