public static string GetParameterValue(string delimiteParamString, string paramKey, string defaultValue = null) { DbConnectionStringBuilder paramStringParse = new DbConnectionStringBuilder { ConnectionString = delimiteParamString }; object val; if(!paramStringParse.TryGetValue(paramKey, out val)) return defaultValue; return val.ToStringEx(); }
/// <summary> /// Aspect that log SQL Execution plan of an intercepted SqlCommand. /// </summary> /// <param name="formatXmlOrText"> /// string in the format of "format=text;" or "format=xml;". /// If not specified, XML format is used. /// </param> public SqlCmdExecutionPlanAspect(string formatXmlOrText) : this(cmdFetcher : null) { if (!formatXmlOrText.IsBlank()) { this.TrueText_FalseXml = bool.Parse(DefaultAspect.GetParameterValue(formatXmlOrText, "format", "false")); } }