Pattern matching C# 7.0 is a very powerful feature however matching properties within objects was verbose.
This syntax simplifies the syntax by allowing dot notation to match the property directly.
Code
C#
return analysis switch
{
{ MatchedRule.Action: "ignore" } => Action.Ignore,
_ => Action.Block,
};
C#
return analysis switch
{
{ MatchedRule: { Action: "ignore" } } => Action.Ignore,
_ => Action.Block,
};