CodeOwner Struct

Represents a single owner of a CodeOwnersEntry.

var file = CodeOwnersFile.Parse("*.js @user1 docs@example.com", CodeOwnersDialect.GitLab);
var owners = file.Entries[0].Owners;

Assert.Equal(CodeOwnerType.Username, owners[0].Type);
Assert.Equal("user1", owners[0].Name);

Assert.Equal(CodeOwnerType.EmailAddress, owners[1].Type);
Assert.Equal("docs@example.com", owners[1].Name);
public readonly struct CodeOwner : IEquatable<CodeOwner>
Implements

Properties

NameDescription
NameGets the owner identifier: a username without its leading @, an email address, or a role name without its leading @@.
TypeGets how the owner is identified.

Gets the owner identifier: a username without its leading @, an email address, or a role name without its leading @@.

public string Name { get; }

Property value

string

Remarks

The value is the one written in the file, so a role keeps the singular or plural form it was written with.

Gets how the owner is identified.

public CodeOwnerType Type { get; }

Property value

CodeOwnerType

Methods

NameDescription
Equals(CodeOwner)
Equals(object?)
GetHashCode()
ToString()Returns the owner as written in a CODEOWNERS file.

Equals overloads

Equals(CodeOwner)

CodeOwner.cs
public bool Equals(CodeOwner other)
Parameters
other CodeOwner
Returns

bool

No documentation is available.

Equals(object?)

CodeOwner.cs
public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

CodeOwner.cs
public override int GetHashCode()

Returns

int

No documentation is available.

ToString()

CodeOwner.cs

Returns the owner as written in a CODEOWNERS file.

public override string ToString()

Returns

string

Operators

NameDescription
operator ==(CodeOwner, CodeOwner)
operator !=(CodeOwner, CodeOwner)

operator ==(CodeOwner, CodeOwner)

CodeOwner.cs
public static bool operator ==(CodeOwner left, CodeOwner right)

Parameters

left CodeOwner
right CodeOwner

Returns

bool

No documentation is available.

operator !=(CodeOwner, CodeOwner)

CodeOwner.cs
public static bool operator !=(CodeOwner left, CodeOwner right)

Parameters

left CodeOwner
right CodeOwner

Returns

bool

No documentation is available.