/
DbParameterCollection.cs
156 lines (123 loc) · 6.28 KB
/
DbParameterCollection.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
using System.Collections;
using System.Diagnostics.CodeAnalysis;
namespace System.Data.Common
{
public abstract class DbParameterCollection : MarshalByRefObject, IDataParameterCollection
{
protected DbParameterCollection() : base() { }
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public abstract int Count { get; }
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public virtual bool IsFixedSize => false;
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public virtual bool IsReadOnly => false;
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public virtual bool IsSynchronized => false;
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public abstract object SyncRoot { get; }
object? IList.this[int index]
{
get { return GetParameter(index); }
set { SetParameter(index, (DbParameter)value!); }
}
object IDataParameterCollection.this[string parameterName]
{
get { return GetParameter(parameterName); }
set { SetParameter(parameterName, (DbParameter)value!); }
}
public DbParameter this[int index]
{
get { return GetParameter(index); }
set { SetParameter(index, value); }
}
public DbParameter this[string parameterName]
{
get { return GetParameter(parameterName) as DbParameter; }
set { SetParameter(parameterName, value); }
}
/// <summary>
/// For a description of this member, see <see cref="IList.Add" />.
/// </summary>
/// <param name="value">For a description of this member, see <see cref="IList.Add" />.</param>
/// <returns>For a description of this member, see <see cref="IList.Add" />.</returns>
/// <remarks>
/// This member is an explicit interface member implementation.
/// It can be used only when the <see cref="DbParameterCollection" /> instance is cast to
/// <see cref="IList" /> interface.
/// </remarks>
int IList.Add(object? value) => Add(value!);
public abstract int Add(object value);
public abstract void AddRange(System.Array values);
/// <summary>
/// For a description of this member, see <see cref="IList.Contains" />.
/// </summary>
/// <param name="value">For a description of this member, see <see cref="IList.Contains" />.</param>
/// <returns>For a description of this member, see <see cref="IList.Contains" />.</returns>
/// <remarks>
/// This member is an explicit interface member implementation.
/// It can be used only when the <see cref="DbParameterCollection" /> instance is cast to
/// <see cref="IList" /> interface.
/// </remarks>
bool IList.Contains(object? value) => Contains(value!);
public abstract bool Contains(object value);
public abstract bool Contains(string value);
public abstract void CopyTo(System.Array array, int index);
public abstract void Clear();
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract IEnumerator GetEnumerator();
protected abstract DbParameter GetParameter(int index);
protected abstract DbParameter GetParameter(string parameterName);
/// <summary>
/// For a description of this member, see <see cref="IList.IndexOf" />.
/// </summary>
/// <param name="value">For a description of this member, see <see cref="IList.IndexOf" />.</param>
/// <returns>For a description of this member, see <see cref="IList.IndexOf" />.</returns>
/// <remarks>
/// This member is an explicit interface member implementation.
/// It can be used only when the <see cref="DbParameterCollection" /> instance is cast to
/// <see cref="IList" /> interface.
/// </remarks>
int IList.IndexOf(object? value) => IndexOf(value!);
public abstract int IndexOf(object value);
public abstract int IndexOf(string parameterName);
/// <summary>
/// For a description of this member, see <see cref="IList.Insert" />.
/// </summary>
/// <param name="index">For a description of this member, see <see cref="IList.Insert" />.</param>
/// <param name="value">For a description of this member, see <see cref="IList.Insert" />.</param>
/// <remarks>
/// This member is an explicit interface member implementation.
/// It can be used only when the <see cref="DbParameterCollection" /> instance is cast to
/// <see cref="IList" /> interface.
/// </remarks>
void IList.Insert(int index, object? value) => Insert(index, value!);
public abstract void Insert(int index, object value);
/// <summary>
/// For a description of this member, see <see cref="IList.Remove" />.
/// </summary>
/// <param name="value">For a description of this member, see <see cref="IList.Remove" />.</param>
/// <remarks>
/// This member is an explicit interface member implementation.
/// It can be used only when the <see cref="DbParameterCollection" /> instance is cast to
/// <see cref="IList" /> interface.
/// </remarks>
void IList.Remove(object? value) => Remove(value!);
public abstract void Remove(object value);
public abstract void RemoveAt(int index);
public abstract void RemoveAt(string parameterName);
protected abstract void SetParameter(int index, DbParameter value);
protected abstract void SetParameter(string parameterName, DbParameter value);
}
}