Base class:
protected virtual List<string> Name { get; } = null;
Child class
protected override List<string> Name => new List<string>();// No error
if write equal operator:
protected override List<string> Name = new List<string>();
the compiler raise error:
"The modifier 'override' is not valid for this item"
=> is an anonymous function. In both cases we are assigning value to the Name
member. Why is compiler giving error for =
operator.