{"id":22065779,"url":"https://github.com/karenpayneoregon/entityframeworkenum","last_synced_at":"2026-05-09T16:33:43.410Z","repository":{"id":110840570,"uuid":"200248282","full_name":"karenpayneoregon/EntityFrameworkEnum","owner":"karenpayneoregon","description":"Entity Framework 6 Enum support","archived":false,"fork":false,"pushed_at":"2022-06-04T11:50:45.000Z","size":107,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T19:04:26.854Z","etag":null,"topics":["database","entity-framework"],"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/karenpayneoregon.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":"2019-08-02T14:25:05.000Z","updated_at":"2024-06-11T18:41:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4588de3-49d3-4153-a7ea-177f8c73e986","html_url":"https://github.com/karenpayneoregon/EntityFrameworkEnum","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/karenpayneoregon/EntityFrameworkEnum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2FEntityFrameworkEnum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2FEntityFrameworkEnum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2FEntityFrameworkEnum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2FEntityFrameworkEnum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karenpayneoregon","download_url":"https://codeload.github.com/karenpayneoregon/EntityFrameworkEnum/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2FEntityFrameworkEnum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012643,"owners_count":26085158,"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-10-12T02:00:06.719Z","response_time":53,"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":["database","entity-framework"],"created_at":"2024-11-30T19:21:53.504Z","updated_at":"2025-10-12T19:05:33.372Z","avatar_url":"https://github.com/karenpayneoregon.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TechNet article\nEntity Framework database/Code First Enum support\n\nhttps://social.technet.microsoft.com/wiki/contents/articles/53169.entity-framework-databasecode-first-enum-support.aspx\n\n**See also**\n\n[Windows forms Entity Framework Code first from database](https://social.technet.microsoft.com/wiki/contents/articles/53154.windows-forms-entity-framework-code-first-from-database.aspx)\n\n# EF Core Value Conversions\n\nSee the following [repository](https://github.com/karenpayneoregon/ef-core-transforming) for working with `enum` and more.\n\nExample, `BookCatgory` is an `enum`\n\n```csharp\nprotected override void OnModelCreating(ModelBuilder modelBuilder)\n{\n    modelBuilder.HasAnnotation(\"Relational:Collation\", \"SQL_Latin1_General_CP1_CI_AS\");\n\n\n    modelBuilder\n        .Entity\u003cBook\u003e()\n        .Property(e =\u003e e.BookCategory)\n        .HasConversion\u003cint\u003e();\n\n    modelBuilder\n        .Entity\u003cBookVariant\u003e().HasData(\n            Enum.GetValues(typeof(BookCategory))\n                .Cast\u003cBookCategory\u003e()\n                .Select(e =\u003e new BookVariant()\n                {\n                    BookCategoryId = e,\n                    Name = e.ToString()\n                })\n        );\n}\n```\n\n**Sample query**\n\n```csharp\nvar list = bookList.Where(books =\u003e books.BookCategory == BookCategory.Adventure).ToList();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarenpayneoregon%2Fentityframeworkenum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarenpayneoregon%2Fentityframeworkenum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarenpayneoregon%2Fentityframeworkenum/lists"}