SQLiteContext.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Ant.Core;
  2. using Ant.Core.Visitors;
  3. using Ant.Data;
  4. using Ant.DbExpressions;
  5. using Ant.Descriptors;
  6. using Ant.Entity;
  7. using Ant.Exceptions;
  8. using Ant.Infrastructure;
  9. using Ant.ORM;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Linq.Expressions;
  14. using System.Reflection;
  15. using System.Text;
  16. namespace Ant.SQLite
  17. {
  18. public class SQLiteContext : DbContext
  19. {
  20. DbContextServiceProvider _dbContextServiceProvider;
  21. public SQLiteContext(IDbConnectionFactory dbConnectionFactory)
  22. {
  23. Utils.CheckNull(dbConnectionFactory);
  24. this._dbContextServiceProvider = new DbContextServiceProvider(dbConnectionFactory);
  25. }
  26. public SQLiteContext(string connString)
  27. {
  28. }
  29. /// <summary>
  30. /// 数据库类型
  31. /// </summary>
  32. public override DatabaseType DatabaseType
  33. {
  34. get { return DatabaseType.SQLite; }
  35. }
  36. public override IDbContextServiceProvider DbContextServiceProvider
  37. {
  38. get { return this._dbContextServiceProvider; }
  39. }
  40. protected override string GetSelectLastInsertIdClause()
  41. {
  42. return "SELECT LAST_INSERT_ROWID()";
  43. }
  44. }
  45. }