public override string ToString() { if (SerilogExpression.IsValidIdentifier(MemberName)) { return(Receiver + "." + MemberName); } return($"{Receiver}['{SerilogExpression.EscapeStringContent(MemberName)}']"); }
public AmbientPropertyExpression(string propertyName, bool isBuiltIn) { PropertyName = propertyName ?? throw new ArgumentNullException(nameof(propertyName)); IsBuiltIn = isBuiltIn; _requiresEscape = !SerilogExpression.IsValidIdentifier(propertyName); }