47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using System;
|
|
|
|
namespace SharpChat.Database.Null {
|
|
public class NullDatabaseCommand : IDatabaseCommand {
|
|
public IDatabaseConnection Connection { get; }
|
|
|
|
public string CommandString => string.Empty;
|
|
public int CommandTimeout { get => -1; set { } }
|
|
|
|
public NullDatabaseCommand(NullDatabaseConnection conn) {
|
|
Connection = conn ?? throw new ArgumentNullException(nameof(conn));
|
|
}
|
|
|
|
public IDatabaseParameter AddParameter(string name, object value)
|
|
=> new NullDatabaseParameter();
|
|
|
|
public IDatabaseParameter AddParameter(string name, DatabaseType type)
|
|
=> new NullDatabaseParameter();
|
|
|
|
public IDatabaseParameter AddParameter(IDatabaseParameter param) {
|
|
if(param is not NullDatabaseParameter)
|
|
throw new InvalidParameterClassTypeException();
|
|
return param;
|
|
}
|
|
|
|
public void AddParameters(IDatabaseParameter[] @params) {}
|
|
public void ClearParameters() {}
|
|
|
|
public void Dispose() {
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
|
|
public int Execute() {
|
|
return 0;
|
|
}
|
|
|
|
public IDatabaseReader ExecuteReader() {
|
|
return new NullDatabaseReader();
|
|
}
|
|
|
|
public object ExecuteScalar() {
|
|
return null;
|
|
}
|
|
|
|
public void Prepare() {}
|
|
}
|
|
}
|