/
InformixOptions.cs
58 lines (49 loc) · 1.87 KB
/
InformixOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
namespace LinqToDB.DataProvider.Informix
{
using Common;
using Common.Internal;
using Data;
/// <param name="BulkCopyType">
/// Default bulk copy mode, used for Informix by <see cref="DataConnectionExtensions.BulkCopy{T}(DataConnection, IEnumerable{T})"/>
/// methods, if mode is not specified explicitly.
/// Default value: <see cref="BulkCopyType.ProviderSpecific"/>.
/// </param>
/// <param name="ExplicitFractionalSecondsSeparator">
/// Enables use of explicit fractional seconds separator in datetime values. Must be enabled for Informix starting from v11.70.xC8 and v12.10.xC2.
/// More details at: https://www.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.po.doc/new_features_ce.htm#newxc2__xc2_datetime
/// </param>
public sealed record InformixOptions
(
BulkCopyType BulkCopyType = BulkCopyType.ProviderSpecific,
bool ExplicitFractionalSecondsSeparator = true
// If you add another parameter here, don't forget to update
// InformixOptions copy constructor and CreateID method.
)
: DataProviderOptions<InformixOptions>(BulkCopyType)
{
public InformixOptions() : this(BulkCopyType.ProviderSpecific)
{
}
InformixOptions(InformixOptions original) : base(original)
{
ExplicitFractionalSecondsSeparator = original.ExplicitFractionalSecondsSeparator;
}
protected override IdentifierBuilder CreateID(IdentifierBuilder builder) => builder
.Add(ExplicitFractionalSecondsSeparator)
;
#region IEquatable implementation
public bool Equals(InformixOptions? other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return ((IOptionSet)this).ConfigurationID == ((IOptionSet)other).ConfigurationID;
}
public override int GetHashCode()
{
return ((IOptionSet)this).ConfigurationID;
}
#endregion
}
}