SqlSugar/Src/Asp.NetCore2/MongoDb.Ado.data/EmptyDbParameterCollection.cs
2025-05-04 15:59:46 +08:00

50 lines
1.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Text;
namespace MongoDb.Ado.data
{
// 将类的访问修饰符从 private 更改为 internal以解决 CS1527 错误
internal class EmptyDbParameterCollection : DbParameterCollection
{
public override int Add(object value) => 0;
public override void AddRange(Array values) { }
public override void Clear() { }
public override bool Contains(string value) => false;
public override bool Contains(object value) => false;
public override void CopyTo(Array array, int index) { }
public override int Count => 0;
public override System.Collections.IEnumerator GetEnumerator() => Array.Empty<object>().GetEnumerator();
public override int IndexOf(string parameterName) => -1;
public override int IndexOf(object value) => -1;
public override void Insert(int index, object value) { }
public override bool IsFixedSize => true;
public override bool IsReadOnly => true;
public override bool IsSynchronized => false;
public override void Remove(object value) { }
public override void RemoveAt(string parameterName) { }
public override void RemoveAt(int index) { }
protected override DbParameter GetParameter(int index)
{
throw new NotImplementedException();
}
protected override DbParameter GetParameter(string parameterName)
{
return null;
}
protected override void SetParameter(int index, DbParameter value)
{
}
protected override void SetParameter(string parameterName, DbParameter value)
{
}
public override object SyncRoot => new object();
}
}