Show / Hide Table of Contents

Class Scope

Defines a scope path in Roster.

Inheritance
System.Object
Scope
Namespace: Microsoft.GNS.Roster
Assembly: Microsoft.GNS.Roster.Common.dll
Syntax
public class Scope : object

Fields

View Source

Empty

Represents and unset object.

Declaration
public static readonly Scope Empty
Field Value
Type Description
Scope
View Source

OrgIdentifier

Org scope identifier.

Declaration
public const string OrgIdentifier = null
Field Value
Type Description
System.String
View Source

ProjectIdentifier

Project scope identifier.

Declaration
public const string ProjectIdentifier = null
Field Value
Type Description
System.String
View Source

Root

The root Roster scope.

Declaration
public static readonly Scope Root
Field Value
Type Description
Scope
View Source

ToolIdentifier

Tool scope identifier.

Declaration
public const string ToolIdentifier = null
Field Value
Type Description
System.String
View Source

UserIdentifier

User scope identifier.

Declaration
public const string UserIdentifier = null
Field Value
Type Description
System.String

Methods

View Source

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
View Source

GetScopeEntries()

Gets each scope section as a separate ScopeEntry.

Declaration
public IEnumerable<ScopeEntry> GetScopeEntries()
Returns
Type Description
IEnumerable<ScopeEntry>

An enumeration of scope entries.

View Source

IsUserScope(Guid, out Scope)

Determines if the scope is a user scope.

Declaration
public bool IsUserScope(Guid userId, out Scope baseNonUserScope)
Parameters
Type Name Description
Guid userId

The user Id from AAD.

Scope baseNonUserScope

The scope sans the user portion. If non-user scope then that same scope is returned.

Returns
Type Description
System.Boolean

The non-user portion of the scope.

View Source

OrgProjectScope(Guid, Guid)

Gets the user scope for an org and project metadata is associated with.

Declaration
public static Scope OrgProjectScope(Guid orgId, Guid projectId)
Parameters
Type Name Description
Guid orgId

The org a tool belongs too.

Guid projectId

The project the metadata is associated with.

Returns
Type Description
Scope

The org project tool metadata scope.

View Source

OrgProjectToolScope(Guid, Guid, Guid)

Gets the scope for an org, project, and tool metadata is associated with.

Declaration
public static Scope OrgProjectToolScope(Guid orgId, Guid projectId, Guid toolId)
Parameters
Type Name Description
Guid orgId

The org a tool belongs too.

Guid projectId

The project the metadata is associated with.

Guid toolId

The tool the metadata is associated with.

Returns
Type Description
Scope

The org project tool metadata scope.

View Source

OrgProjectToolUserScope(Guid, Guid, Guid, Guid)

Gets the scope for an org, project, and tool metadata is associated with.

Declaration
public static Scope OrgProjectToolUserScope(Guid orgId, Guid projectId, Guid toolId, Guid userId)
Parameters
Type Name Description
Guid orgId

The org a tool belongs too.

Guid projectId

The project the metadata is associated with.

Guid toolId

The tool the metadata is associated with.

Guid userId

The user Id from AAD.

Returns
Type Description
Scope

The org project tool metadata scope.

View Source

OrgProjectUserScope(Guid, Guid, Guid)

Gets the user scope for an org and project metadata is associated with.

Declaration
public static Scope OrgProjectUserScope(Guid orgId, Guid projectId, Guid userId)
Parameters
Type Name Description
Guid orgId

The org a tool belongs too.

Guid projectId

The project the metadata is associated with.

Guid userId

The user Id from AAD.

Returns
Type Description
Scope

The org project tool metadata scope.

View Source

OrgScope(Guid)

Gets the scope an org.

Declaration
public static Scope OrgScope(Guid orgId)
Parameters
Type Name Description
Guid orgId

The Id of the org a tool belongs to.

Returns
Type Description
Scope

The org tool scope.

View Source

OrgUserScope(Guid, Guid)

Gets the user scope for an org.

Declaration
public static Scope OrgUserScope(Guid orgId, Guid userId)
Parameters
Type Name Description
Guid orgId

The Id of the org a tool belongs to.

Guid userId

The user Id from AAD.

Returns
Type Description
Scope

The org tool scope.

View Source

Parse(Nullable<String>)

Parses a string into a Scope.

Declaration
public static Scope Parse(string? scopeString)
Parameters
Type Name Description
System.Nullable<System.String> scopeString

The string to parse.

Returns
Type Description
Scope

A Scope determined to be of a valid format.

View Source

SafeEncode()

Converts the scope to a system supported encoding.

Declaration
public string SafeEncode()
Returns
Type Description
System.String

The encoded string.

View Source

SubScopes()

Gets each subscope of the current scope as a scope.

Declaration
public IEnumerable<Scope> SubScopes()
Returns
Type Description
IEnumerable<Scope>

An enumeration of scopes.

View Source

ToOrgProjectScope(Guid)

Converts an org scope to a org/project scope.

Declaration
public Scope ToOrgProjectScope(Guid projectId)
Parameters
Type Name Description
Guid projectId

The project to append to the org scope.

Returns
Type Description
Scope

The updated scope.

View Source

ToOrgToolScope(Guid)

Converts an org scope to a org/tool scope.

Declaration
public Scope ToOrgToolScope(Guid toolId)
Parameters
Type Name Description
Guid toolId

The tool to append to the org scope.

Returns
Type Description
Scope

The updated scope.

View Source

ToString()

Converts the current scope into its string representation.

Declaration
public override string ToString()
Returns
Type Description
System.String

This scope as a string.

View Source

TryDecodeString(Nullable<String>, out Scope)

Tries to decode a string into a scope.

Declaration
public static bool TryDecodeString(string? encodedValue, out Scope scope)
Parameters
Type Name Description
System.Nullable<System.String> encodedValue

The encoded string value.

Scope scope

The output Scope.

Returns
Type Description
System.Boolean

True if successfully decoded. Otherwise, false.

View Source

TryParse(Nullable<String>, out Scope)

Attempts to parse string into a Scope.

Declaration
public static bool TryParse(string? scopeString, out Scope scope)
Parameters
Type Name Description
System.Nullable<System.String> scopeString

The string to parse.

Scope scope

The output Scope object.

Returns
Type Description
System.Boolean

True if successfully parsed. Otherwise, false.

View Source

UserScope(Guid)

Gets the scope for a user in the root.

Declaration
public static Scope UserScope(Guid userId)
Parameters
Type Name Description
Guid userId

The user Id from AAD.

Returns
Type Description
Scope

The root user scope.

  • View Source
In This Article
Back to top Generated by DocFX