mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-26 14:15:50 +08:00
Update Mongodb
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,8 @@ namespace MongoDb.Ado.data
|
||||
set => _connection = (MongoDbConnection)value;
|
||||
}
|
||||
|
||||
protected override DbParameterCollection DbParameterCollection => throw new NotSupportedException("暂不支持参数。");
|
||||
protected override DbParameterCollection DbParameterCollection
|
||||
{ get { return new EmptyDbParameterCollection(); } }
|
||||
|
||||
protected override DbTransaction DbTransaction { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user