SQLiteConfiguration.cs 709 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data.Entity;
  4. using System.Data.Entity.Core.Common;
  5. using System.Data.SQLite;
  6. using System.Data.SQLite.EF6;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace SqliteEFDemo
  11. {
  12. public class SQLiteConfiguration : DbConfiguration
  13. {
  14. public SQLiteConfiguration()
  15. {
  16. SetProviderFactory("System.Data.SQLite", SQLiteFactory.Instance);
  17. SetProviderFactory("System.Data.SQLite.EF6",
  18. SQLiteProviderFactory.Instance);
  19. SetProviderServices("System.Data.SQLite", (DbProviderServices)SQLiteProviderFactory.Instance.GetService(typeof(DbProviderServices)));
  20. }
  21. }
  22. }