/// <summary> /// Constructs a new lock using the provided <paramref name="name"/>. /// /// The provided <paramref name="connection"/> will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and /// will not be opened or closed. /// /// Unless <paramref name="exactName"/> is specified, <paramref name="name"/> will be escaped/hashed to ensure name validity. /// </summary> public OracleDistributedReaderWriterLock(string name, IDbConnection connection, bool exactName = false) : this(name, exactName, n => OracleDistributedLock.CreateInternalLock(n, connection)) { }
private OracleDistributedReaderWriterLock(string name, bool exactName, Func <string, IDbDistributedLock> internalLockFactory) { this.Name = OracleDistributedLock.GetName(name, exactName); this._internalLock = internalLockFactory(this.Name); }
/// <summary> /// Constructs a new lock using the provided <paramref name="name"/>. /// /// The provided <paramref name="connectionString"/> will be used to connect to the database. /// /// Unless <paramref name="exactName"/> is specified, <paramref name="name"/> will be escaped/hashed to ensure name validity. /// </summary> public OracleDistributedReaderWriterLock(string name, string connectionString, Action <OracleConnectionOptionsBuilder>?options = null, bool exactName = false) : this(name, exactName, n => OracleDistributedLock.CreateInternalLock(n, connectionString, options)) { }