Skip to content

Commit e4beb86

Browse files
committed
Refactoring.
1 parent 99def29 commit e4beb86

File tree

1 file changed

+11
-11
lines changed
  • Provider/src/FirebirdSql.Data.FirebirdClient/Services

1 file changed

+11
-11
lines changed

Provider/src/FirebirdSql.Data.FirebirdClient/Services/FbService.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public abstract class FbService
3535
private const string ServiceName = "service_mgr";
3636

3737
private IServiceManager _svc;
38-
private ConnectionString _csManager;
38+
private ConnectionString _options;
3939

4040
internal ServiceParameterBuffer StartSpb;
4141
internal ServiceParameterBuffer QuerySpb;
4242

43-
protected string Database => _csManager.Database;
43+
protected string Database => _options.Database;
4444

4545
public FbServiceState State { get; private set; }
4646
public int QueryBufferSize { get; set; }
@@ -56,7 +56,7 @@ public string ConnectionString
5656
throw new InvalidOperationException("ConnectionString cannot be modified on open instances.");
5757
}
5858

59-
_csManager = new ConnectionString(value);
59+
_options = new ConnectionString(value);
6060

6161
if (value == null)
6262
{
@@ -87,31 +87,31 @@ private ServiceParameterBuffer BuildSpb()
8787
}
8888
else
8989
{
90-
spb.Append((byte)IscCodes.isc_spb_user_name, _csManager.UserID);
91-
spb.Append((byte)IscCodes.isc_spb_password, _csManager.Password);
90+
spb.Append((byte)IscCodes.isc_spb_user_name, _options.UserID);
91+
spb.Append((byte)IscCodes.isc_spb_password, _options.Password);
9292
}
9393
spb.Append((byte)IscCodes.isc_spb_dummy_packet_interval, new byte[] { 120, 10, 0, 0 });
94-
if ((_csManager?.Role.Length ?? 0) != 0)
95-
spb.Append((byte)IscCodes.isc_spb_sql_role_name, _csManager.Role);
94+
if ((_options?.Role.Length ?? 0) != 0)
95+
spb.Append((byte)IscCodes.isc_spb_sql_role_name, _options.Role);
9696
return spb;
9797
}
9898

9999
protected void Open()
100100
{
101101
if (State != FbServiceState.Closed)
102102
throw new InvalidOperationException("Service already Open.");
103-
if (string.IsNullOrEmpty(_csManager.UserID))
103+
if (string.IsNullOrEmpty(_options.UserID))
104104
throw new InvalidOperationException("No user name was specified.");
105-
if (string.IsNullOrEmpty(_csManager.Password))
105+
if (string.IsNullOrEmpty(_options.Password))
106106
throw new InvalidOperationException("No user password was specified.");
107107

108108
try
109109
{
110110
if (_svc == null)
111111
{
112-
_svc = ClientFactory.CreateServiceManager(_csManager);
112+
_svc = ClientFactory.CreateServiceManager(_options);
113113
}
114-
_svc.Attach(BuildSpb(), _csManager.DataSource, _csManager.Port, ServiceName, _csManager.CryptKey);
114+
_svc.Attach(BuildSpb(), _options.DataSource, _options.Port, ServiceName, _options.CryptKey);
115115
_svc.WarningMessage = OnWarningMessage;
116116
State = FbServiceState.Open;
117117
}

0 commit comments

Comments
 (0)