コード例 #1
0
        public override string ToString()
        {
            if (SerilogExpression.IsValidIdentifier(MemberName))
            {
                return(Receiver + "." + MemberName);
            }

            return($"{Receiver}['{SerilogExpression.EscapeStringContent(MemberName)}']");
        }
コード例 #2
0
 public AmbientPropertyExpression(string propertyName, bool isBuiltIn)
 {
     PropertyName    = propertyName ?? throw new ArgumentNullException(nameof(propertyName));
     IsBuiltIn       = isBuiltIn;
     _requiresEscape = !SerilogExpression.IsValidIdentifier(propertyName);
 }