{"id":16691499,"url":"https://github.com/bbonkr/ef6-sqlite-sample","last_synced_at":"2026-05-07T01:05:35.405Z","repository":{"id":149789787,"uuid":"53010085","full_name":"bbonkr/ef6-sqlite-sample","owner":"bbonkr","description":"Entity Framework 6 with Sqlite Sample project","archived":false,"fork":false,"pushed_at":"2016-03-04T03:50:09.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T21:27:31.306Z","etag":null,"topics":["dotnet","dotnet-framework","entity-framework","orm","sample","sql","sqlite"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbonkr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-03T01:27:56.000Z","updated_at":"2024-04-01T04:57:30.000Z","dependencies_parsed_at":"2023-06-02T15:30:42.828Z","dependency_job_id":null,"html_url":"https://github.com/bbonkr/ef6-sqlite-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bbonkr/ef6-sqlite-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbonkr%2Fef6-sqlite-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbonkr%2Fef6-sqlite-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbonkr%2Fef6-sqlite-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbonkr%2Fef6-sqlite-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbonkr","download_url":"https://codeload.github.com/bbonkr/ef6-sqlite-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbonkr%2Fef6-sqlite-sample/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268040228,"owners_count":24185845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","dotnet-framework","entity-framework","orm","sample","sql","sqlite"],"created_at":"2024-10-12T16:08:44.866Z","updated_at":"2026-05-07T01:05:35.380Z","avatar_url":"https://github.com/bbonkr.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Entity Framework 6 with SQLite\n==============================\n\n## Package\n\n아래 두 Nuget Package 를 추가합니다.\n\n프로젝트의 packages.config 파일의 내용을 확인하십시오.\n\n### NuGet Package\n* System.Data.SQLite\n* System.Data.SQLite.EF6\n\n### Packages\n* EntityFramework\n* System.Data.SQLite\n* System.Data.SQLite.Core\n* System.Data.SQLite.EF6\n* System.Data.SQLite.Linq\n\n## config\n\napp.config 혹은 web.config 에는 아래와 같은 요소 Element 가 필요합니다.\n\nNuGet Package 추가시 일부 config가 입력됩니다만, 다시 한번 확인해야 합니다.\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cconfiguration\u003e\n    \u003cconfigSections\u003e\n        \u003c!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --\u003e\n        \u003csection name=\"entityFramework\" type=\"System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" requirePermission=\"false\" /\u003e\n    \u003c/configSections\u003e\n    \u003cstartup\u003e\n        \u003csupportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.6.1\" /\u003e\n    \u003c/startup\u003e\n    \u003cconnectionStrings\u003e\n        \u003cadd name=\"DatabaseContext\" connectionString=\"Data Source=|DataDirectory|data.db\" providerName=\"System.Data.SQLite.EF6\" /\u003e\n    \u003c/connectionStrings\u003e\n    \u003centityFramework\u003e\n        \u003cdefaultConnectionFactory type=\"System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework\"\u003e\n            \u003cparameters\u003e\n                \u003cparameter value=\"v12.0\" /\u003e\n            \u003c/parameters\u003e\n        \u003c/defaultConnectionFactory\u003e\n        \u003cproviders\u003e\n            \u003cprovider invariantName=\"System.Data.SQLite\" type=\"System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.99.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139\"/\u003e\n            \u003cprovider invariantName=\"System.Data.SqlClient\" type=\"System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer\" /\u003e\n            \u003cprovider invariantName=\"System.Data.SQLite.EF6\" type=\"System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6\" /\u003e\n        \u003c/providers\u003e\n    \u003c/entityFramework\u003e\n    \u003csystem.data\u003e\n        \u003cDbProviderFactories\u003e\n            \u003cremove invariant=\"System.Data.SQLite.EF6\" /\u003e\n            \u003cadd name=\"SQLite Data Provider (Entity Framework 6)\" invariant=\"System.Data.SQLite.EF6\" description=\".NET Framework Data Provider for SQLite (Entity Framework 6)\" type=\"System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6\" /\u003e\n            \u003cremove invariant=\"System.Data.SQLite\" /\u003e\n            \u003cadd name=\"SQLite Data Provider\" invariant=\"System.Data.SQLite\" description=\".NET Framework Data Provider for SQLite\" type=\"System.Data.SQLite.SQLiteFactory, System.Data.SQLite\" /\u003e\n        \u003c/DbProviderFactories\u003e\n    \u003c/system.data\u003e\n\u003c/configuration\u003e\n```\n\n## 파일 추가\n\nSQLite.Interop.dll 파일을 추가합니다. System.Data.SQLite.Core 패키지 내용 중 포함되어져 있으므로 프로젝트에 링크로 추가하면 됩니다.\n프로젝트에 파일 추가 후 파일의 속성 창을 열고 아래와 같이 변경합니다.\n\n* 빌드작업: 내용\n* 출력 디렉터리에 복사: 새 버전이면 복사\n\n## 프로젝트 파일 구조\n```plaintext\n│  App.config\n│  data.db\n│  Form1.cs\n│  Form1.Designer.cs\n│  Form1.resx\n│  packages.config\n│  Program.cs\n│  SqliteSmaple.csproj\n│\n├─Lib\n│      DatabaseContext.cs\n│\n├─Model\n│      Todo.cs\n│\n├─Properties\n│      AssemblyInfo.cs\n│      Resources.Designer.cs\n│      Resources.resx\n│      Settings.Designer.cs\n│      Settings.settings\n│\n├─x64\n│      SQLite.Interop.dll\n└─x86\n       SQLite.Interop.dll\n```\n\n## EF6 SQLite 참조\nCode First EF를 구현하려고 했으나, EF6 은 SQLite 에 대한 Migration 을 공식적으로 지원하지 않습니다.\n\n[stackoverflow: Entity Framework 6 with SQLite 3 Code First - Won't create tables](http://stackoverflow.com/questions/22174212/entity-framework-6-with-sqlite-3-code-first-wont-create-tables)\n\n그래서, `data.db` 파일을 만들고, 테이블을 생성한 후 작업을 해야 합니다.\n\n\u003e SQL Server Compact/SQLite Toolbox 확장을 설치하면 편리하게 파일 생성 및 테이블 생성을 할 수 있습니다.\n\nEF7 부터는 지원할 예정이라고 하니, EF7 정식버전이 출시되면 다시 한번 시도해봐야겠습니다.\n\n## 프로젝트 설명\n\n간단한 Todo 목록을 입력하는 응용 프로그램입니다.\n\nModel 디렉터리 하위의 Todo 클래스가 Todo 테이블과 맵핑되는 클래스입니다.\n\nLib 디렉터리 하위의 DatabaseContext가 데이터베이스와 연결되어 엔티티를 관리하는 클래스입니다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbonkr%2Fef6-sqlite-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbonkr%2Fef6-sqlite-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbonkr%2Fef6-sqlite-sample/lists"}