SugarConnection.cs 530 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace SqlSugar
  8. {
  9. public class SugarConnection:IDisposable
  10. {
  11. public IDbConnection conn { get; set; }
  12. public bool IsAutoClose { get; set; }
  13. public ISqlSugarClient Context { get; set; }
  14. public void Dispose()
  15. {
  16. conn.Close();
  17. this.Context.CurrentConnectionConfig.IsAutoCloseConnection = IsAutoClose;
  18. }
  19. }
  20. }