You cannot initialize the class props because they are private.
here you are trying to init your class using one line initializer
but your props are private, so you cannot access them.
new Number { numbVal = 1, numbStr = "One"};
you can set the encapsulation level of the props in the Number class to public to fix this error.
public class Number
{
public int intVal { get; set; }
public string strVal { get; set; }
}
By the way the convention for props is encapsulation level as public and naming in PascalCase.
And another error is that you are missing an implicit casting from Number to myIntIdentClass
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…