I have following c# code.
i don't know the meaning of =>
operator in this code!!
public class ClassA: ClassB
{
public string Type => "article";
}
I have following c# code.
i don't know the meaning of =>
operator in this code!!
public class ClassA: ClassB
{
public string Type => "article";
}
This is a shorthand syntax that was introduced in C# 6. The sample that you provided is a shorthand for readonly property and it is equivalent to
public class ClassA: ClassB
{
public string Type
{
get { return "article"; }
}
}