Table of Contents

Class SqlObjectBuilder

Namespace
LfrlAnvil.Sql.Objects.Builders
Assembly
LfrlAnvil.Sql.Core.dll

Represents an SQL object builder.

public abstract class SqlObjectBuilder : SqlBuilderApi, ISqlObjectBuilder
Inheritance
SqlObjectBuilder
Implements
Derived
Inherited Members

Constructors

SqlObjectBuilder(SqlDatabaseBuilder, string)

Creates a new SqlObjectBuilder instance.

protected SqlObjectBuilder(SqlDatabaseBuilder database, string name)

Parameters

database SqlDatabaseBuilder

Database that this object belongs to.

name string

Object's name.

Properties

CanRemove

Specifies whether or not this object can be removed.

public virtual bool CanRemove { get; }

Property Value

bool

Database

Database that this object belongs to.

public SqlDatabaseBuilder Database { get; }

Property Value

SqlDatabaseBuilder

Id

Unique identifier of this object builder within its Database.

public ulong Id { get; }

Property Value

ulong

IsRemoved

Specifies whether or not this object has been removed.

public bool IsRemoved { get; }

Property Value

bool

Name

Object's name.

public string Name { get; }

Property Value

string

ReferencingObjects

Collection of sources that reference this object.

public SqlObjectBuilderReferenceCollection<SqlObjectBuilder> ReferencingObjects { get; }

Property Value

SqlObjectBuilderReferenceCollection<SqlObjectBuilder>

Type

Object's type.

public SqlObjectType Type { get; }

Property Value

SqlObjectType

Methods

AfterNameChange(string)

Callback invoked just after Name change has been processed.

protected abstract void AfterNameChange(string originalValue)

Parameters

originalValue string

Original value.

AfterRemove()

Callback invoked just after the removal has been processed.

protected abstract void AfterRemove()

BeforeNameChange(string)

Callback invoked just before Name change is processed.

protected virtual SqlPropertyChange<string> BeforeNameChange(string newValue)

Parameters

newValue string

Value to set.

Returns

SqlPropertyChange<string>

SqlPropertyChange<T> instance associated with Name change attempt.

Exceptions

SqlObjectBuilderException

When Name of this object cannot be changed.

BeforeRemove()

Callback invoked just before the removal is processed.

protected virtual void BeforeRemove()

Exceptions

SqlObjectBuilderException

When this object cannot be removed.

GetHashCode()

Serves as the default hash function.

[Pure]
public override sealed int GetHashCode()

Returns

int

A hash code for the current object.

QuickRemoveCore()

Performs a quick removal of this object.

protected virtual void QuickRemoveCore()

Remarks

See QuickRemove(SqlObjectBuilder) for more information.

Remove()

Removes this object.

public void Remove()

Exceptions

SqlObjectBuilderException

When this object cannot be removed.

SetName(string)

Changes the name of this object.

public SqlObjectBuilder SetName(string name)

Parameters

name string

Name to set.

Returns

SqlObjectBuilder

this.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

ThrowIfReferenced()

Throws an exception when ReferencingObjects is not empty.

public void ThrowIfReferenced()

Exceptions

SqlObjectBuilderException

When ReferencingObjects is not empty.

ThrowIfRemoved()

Throws an exception when IsRemoved is equal to true.

public void ThrowIfRemoved()

Exceptions

SqlObjectBuilderException

When IsRemoved is equal to true.

ToString()

Returns a string representation of this SqlObjectBuilder instance.

[Pure]
public override string ToString()

Returns

string

String representation.