C# null coalescing operator returning null

前端 未结 6 2334
小鲜肉
小鲜肉 2021-02-14 10:44

Recently my co-worker showed me a block of code that was not working correctly:

public class SomeClass
{
    private IList _categories;

    publ         


        
6条回答
  •  悲&欢浪女
    2021-02-14 11:28

    This could be a problem with the debugger rather than with the code. Trying printing out the value or doing a null check after the statement with the coalesce operator.

提交回复
热议问题