You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
4.6 KiB

2 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Reflection;
  5. namespace SqlSugar
  6. {
  7. public partial interface IAdo
  8. {
  9. string SqlParameterKeyWord { get; }
  10. IDbConnection Connection { get; set; }
  11. IDbTransaction Transaction { get; set; }
  12. IDataParameter[] ToIDbDataParameter(params SugarParameter[] pars);
  13. SugarParameter[] GetParameters(object obj, PropertyInfo[] propertyInfo = null);
  14. SqlSugarClient Context { get; set; }
  15. void ExecuteBefore(string sql, SugarParameter[] pars);
  16. void ExecuteAfter(string sql, SugarParameter[] pars);
  17. IDataParameterCollection DataReaderParameters { get; set; }
  18. CommandType CommandType { get; set; }
  19. bool IsEnableLogEvent { get; set; }
  20. Action<string, SugarParameter []> LogEventStarting { get; set; }
  21. Action<string, SugarParameter []> LogEventCompleted { get; set; }
  22. Func<string, SugarParameter[], KeyValuePair<string, SugarParameter[]>> ProcessingEventStartingSQL { get; set; }
  23. Action<Exception> ErrorEvent { get; set; }
  24. bool IsClearParameters { get; set; }
  25. int CommandTimeOut { get; set; }
  26. IDbBind DbBind { get; }
  27. void SetCommandToAdapter(IDataAdapter adapter, IDbCommand command);
  28. IDataAdapter GetAdapter();
  29. IDbCommand GetCommand(string sql, SugarParameter[] parameters);
  30. DataTable GetDataTable(string sql, object parameters);
  31. DataTable GetDataTable(string sql, params SugarParameter[] parameters);
  32. DataTable GetDataTable(string sql, List<SugarParameter> parameters);
  33. DataSet GetDataSetAll(string sql, object parameters);
  34. DataSet GetDataSetAll(string sql, params SugarParameter[] parameters);
  35. DataSet GetDataSetAll(string sql, List<SugarParameter> parameters);
  36. IDataReader GetDataReader(string sql, object parameters);
  37. IDataReader GetDataReader(string sql, params SugarParameter[] parameters);
  38. IDataReader GetDataReader(string sql, List<SugarParameter> parameters);
  39. object GetScalar(string sql, object parameters);
  40. object GetScalar(string sql, params SugarParameter[] parameters);
  41. object GetScalar(string sql, List<SugarParameter> parameters);
  42. int ExecuteCommand(string sql, object parameters);
  43. int ExecuteCommand(string sql, params SugarParameter[] parameters);
  44. int ExecuteCommand(string sql, List<SugarParameter> parameters);
  45. string GetString(string sql, object parameters);
  46. string GetString(string sql, params SugarParameter[] parameters);
  47. string GetString(string sql, List<SugarParameter> parameters);
  48. int GetInt(string sql, object pars);
  49. int GetInt(string sql, params SugarParameter[] parameters);
  50. int GetInt(string sql, List<SugarParameter> parameters);
  51. Double GetDouble(string sql, object parameters);
  52. Double GetDouble(string sql, params SugarParameter[] parameters);
  53. Double GetDouble(string sql, List<SugarParameter> parameters);
  54. decimal GetDecimal(string sql, object parameters);
  55. decimal GetDecimal(string sql, params SugarParameter[] parameters);
  56. decimal GetDecimal(string sql, List<SugarParameter> parameters);
  57. DateTime GetDateTime(string sql, object parameters);
  58. DateTime GetDateTime(string sql, params SugarParameter[] parameters);
  59. DateTime GetDateTime(string sql, List<SugarParameter> parameters);
  60. List<T> SqlQuery<T>(string sql, object parameters = null);
  61. List<T> SqlQuery<T>(string sql, params SugarParameter[] parameters);
  62. List<T> SqlQuery<T>(string sql, List<SugarParameter> parameters);
  63. T SqlQuerySingle<T>(string sql, object whereObj = null);
  64. T SqlQuerySingle<T>(string sql, params SugarParameter[] parameters);
  65. T SqlQuerySingle<T>(string sql, List<SugarParameter> parameters);
  66. dynamic SqlQueryDynamic(string sql, object whereObj = null);
  67. dynamic SqlQueryDynamic(string sql, params SugarParameter[] parameters);
  68. dynamic SqlQueryDynamic(string sql, List<SugarParameter> parameters);
  69. void Dispose();
  70. void Close();
  71. void Open();
  72. void CheckConnection();
  73. void BeginTran();
  74. void BeginTran(IsolationLevel iso);
  75. void BeginTran(string transactionName);
  76. void BeginTran(IsolationLevel iso, string transactionName);
  77. void RollbackTran();
  78. void CommitTran();
  79. DbResult<bool> UseTran(Action action);
  80. DbResult<T> UseTran<T>(Func<T> action);
  81. void UseStoredProcedure(Action action);
  82. T UseStoredProcedure<T>(Func<T> action);
  83. IAdo UseStoredProcedure();
  84. }
  85. }