Table of Contents

Class EntityFrameworkLockSettings

Namespace
Silverback.Lock
Assembly
Silverback.Storage.EntityFramework.dll

The EntityFrameworkLock settings.

public record EntityFrameworkLockSettings : TableBasedDistributedLockSettings, IValidatableSettings, IEquatable<DistributedLockSettings>, IEquatable<TableBasedDistributedLockSettings>, IEntityFrameworkSettings, IEquatable<EntityFrameworkLockSettings>
Inheritance
EntityFrameworkLockSettings
Implements
Inherited Members

Constructors

EntityFrameworkLockSettings(EntityFrameworkLockSettings)

protected EntityFrameworkLockSettings(EntityFrameworkLockSettings original)

Parameters

original EntityFrameworkLockSettings

EntityFrameworkLockSettings(string, Type, Func<IServiceProvider, ISilverbackContext?, DbContext>)

Initializes a new instance of the EntityFrameworkLockSettings class.

public EntityFrameworkLockSettings(string lockName, Type dbContextType, Func<IServiceProvider, ISilverbackContext?, DbContext> dbContextFactory)

Parameters

lockName string

The name of the lock.

dbContextType Type

The type of the DbContext to be used to access the database.

dbContextFactory Func<IServiceProvider, ISilverbackContext, DbContext>

The factory method that creates the DbContext instance.

Properties

DbContextType

Gets the type of the DbContext to be used to access the database.

public Type DbContextType { get; }

Property Value

Type

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Methods

Equals(EntityFrameworkLockSettings?)

public virtual bool Equals(EntityFrameworkLockSettings? other)

Parameters

other EntityFrameworkLockSettings

Returns

bool

Equals(TableBasedDistributedLockSettings?)

public override sealed bool Equals(TableBasedDistributedLockSettings? other)

Parameters

other TableBasedDistributedLockSettings

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetDbContext(IServiceProvider, ISilverbackContext?)

Gets the factory method that creates the DbContext instance.

public DbContext GetDbContext(IServiceProvider serviceProvider, ISilverbackContext? context = null)

Parameters

serviceProvider IServiceProvider

The IServiceProvider to be used to resolve the DbContext.

context ISilverbackContext

The ISilverbackContext.

Returns

DbContext

The DbContext instance.

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Validate()

Throws a SilverbackConfigurationException if the configuration is not valid.

public override void Validate()

Operators

operator ==(EntityFrameworkLockSettings?, EntityFrameworkLockSettings?)

public static bool operator ==(EntityFrameworkLockSettings? left, EntityFrameworkLockSettings? right)

Parameters

left EntityFrameworkLockSettings
right EntityFrameworkLockSettings

Returns

bool

operator !=(EntityFrameworkLockSettings?, EntityFrameworkLockSettings?)

public static bool operator !=(EntityFrameworkLockSettings? left, EntityFrameworkLockSettings? right)

Parameters

left EntityFrameworkLockSettings
right EntityFrameworkLockSettings

Returns

bool