CreateWithNewAttributes(string contextName, string attributes)

This method creates a new end-user security context with a single replacement attribute entry.

Declaration

// C#
public OracleEndUserSecurityContext CreateWithNewAttributes(string contextName, string attributes)

Parameters

  • contextName

    Specifies the attribute context name.

  • attributes

    Specifies the attributes payload for the context.

Return Value

A new OracleEndUserSecurityContext containing the specified attribute context and attribute payload.

Exceptions

ArgumentException - Thrown when either contextName or attributes is null or an empty string.

OracleException is thrown if the supplied attributes value in JSON format is invalid.

Remarks

This method creates a new OracleEndUserSecurityContext instance and does not modify the current instance. The returned context contains an attributes dictionary initialized with a single entry for contextName and inherits the existing database access token, end user principal, and data roles. The method also validates and processes the attributes JSON string by generating a binary JSON representation for the new context.

The input values cannot be null nor an empty string.