DbContextServiceProvider.cs 851 B

1234567891011121314151617181920212223242526272829303132333435
  1. using Ant.Core.Visitors;
  2. using Ant.Infrastructure;
  3. using Ant.Query;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Text;
  9. namespace Ant.Oracle
  10. {
  11. class DbContextServiceProvider : IDbContextServiceProvider
  12. {
  13. bool _convertToUppercase;
  14. public DbContextServiceProvider(bool convertToUppercase)
  15. {
  16. this._convertToUppercase = convertToUppercase;
  17. }
  18. public IDbExpressionTranslator CreateDbExpressionTranslator()
  19. {
  20. if (_convertToUppercase == true)
  21. {
  22. return DbExpressionTranslator_ConvertToUppercase.Instance;
  23. }
  24. else
  25. {
  26. return DbExpressionTranslator.Instance;
  27. }
  28. throw new NotSupportedException();
  29. }
  30. }
  31. }