{"id":19654249,"url":"https://github.com/aimenux/enumconverterdemo","last_synced_at":"2026-08-10T09:30:20.086Z","repository":{"id":116560128,"uuid":"476729022","full_name":"aimenux/EnumConverterDemo","owner":"aimenux","description":"Experimenting enum type converters","archived":false,"fork":false,"pushed_at":"2025-06-03T21:31:54.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T08:57:35.757Z","etag":null,"topics":["benchmarks","console-app","enum-converter","fluent-assertions","net60","vs22","xunit-tests"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aimenux.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":"2022-04-01T13:20:06.000Z","updated_at":"2025-06-03T21:31:55.000Z","dependencies_parsed_at":"2023-07-08T16:01:12.114Z","dependency_job_id":null,"html_url":"https://github.com/aimenux/EnumConverterDemo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aimenux/EnumConverterDemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FEnumConverterDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FEnumConverterDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FEnumConverterDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FEnumConverterDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aimenux","download_url":"https://codeload.github.com/aimenux/EnumConverterDemo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FEnumConverterDemo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36484237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"online","status_checked_at":"2026-08-10T02:00:05.122Z","response_time":58,"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":["benchmarks","console-app","enum-converter","fluent-assertions","net60","vs22","xunit-tests"],"created_at":"2024-11-11T15:16:45.119Z","updated_at":"2026-08-10T09:30:20.070Z","avatar_url":"https://github.com/aimenux.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![.NET](https://github.com/aimenux/EnumConverterDemo/actions/workflows/ci.yml/badge.svg)](https://github.com/aimenux/EnumConverterDemo/actions/workflows/ci.yml)\n\n# EnumConverterDemo\n```\nExperimenting enum type converters\n```\n\nIn this demo, i m experimenting ways of conversion from enums (decorated with [EnumMember](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.enummemberattribute)) to strings\n\u003e\nThe enum converter should support the following cases :\n\u003e\n:pushpin: From `string enum value` To `enum value`\n\u003e\n:pushpin: From `string integer enum` value To `enum value`\n\u003e\n:pushpin: From `string enum member value` value To `enum value`\n\nThe built-in implementation [EnumConverter](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.enumconverter) provided by microsoft don't support the last case about [EnumMember](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.enummemberattribute)\n\nIn order to support all the cases, i m testing and benchmarking two implementations :\n\n\u003e\n:one: `StringEnumConverter`\n\u003e\n:two: `CachedStringEnumConverter`\n\n```\n|                         Method |        Mean |       Error |      StdDev |      Median |         Min |         Max | Rank |  Gen 0 | Allocated |\n|------------------------------- |------------:|------------:|------------:|------------:|------------:|------------:|-----:|-------:|----------:|\n| UsingCachedStringEnumConverter |    850.0 ns |    32.96 ns |    95.62 ns |    837.3 ns |    683.3 ns |  1,102.1 ns |    1 | 0.0229 |      96 B |\n|       UsingStringEnumConverter | 27,620.3 ns | 1,816.07 ns | 5,151.88 ns | 25,850.7 ns | 21,417.7 ns | 43,805.8 ns |    2 | 1.0986 |   4,818 B |\n```\n\n**`Tools`** : vs22, net 6.0, xunit, fluent-assertions, benchmark-dotnet\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimenux%2Fenumconverterdemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faimenux%2Fenumconverterdemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimenux%2Fenumconverterdemo/lists"}