UnquoteIdentifier() public method

Given a quoted identifier, returns the correct unquoted form of that identifier, including properly un-escaping any embedded quotes in the identifier.
Quoted identifier parameter cannot be null
public UnquoteIdentifier ( string quotedIdentifier ) : string
quotedIdentifier string The identifier that will have its embedded quotes removed.
return string
        private static string InitSnapshotStoreSql(string tableName, string schemaName = null)
        {
            if (string.IsNullOrEmpty(tableName)) throw new ArgumentNullException("tableName", "Akka.Persistence.PostgreSql snapshot store table name is required");
            schemaName = schemaName ?? "public";

            var cb = new NpgsqlCommandBuilder();
            return string.Format(SqlSnapshotStoreFormat, cb.QuoteIdentifier(schemaName), cb.QuoteIdentifier(tableName), cb.UnquoteIdentifier(schemaName), cb.UnquoteIdentifier(tableName));
        }
コード例 #2
0
ファイル: DataAdapterTests.cs プロジェクト: Emill/Npgsql
 public void CommandBuilderQuoting()
 {
     var cb = new NpgsqlCommandBuilder();
     const string orig = "some\"column";
     var quoted = cb.QuoteIdentifier(orig);
     Assert.That(quoted, Is.EqualTo("\"some\"\"column\""));
     Assert.That(cb.UnquoteIdentifier(quoted), Is.EqualTo(orig));
 }