{"id":24118156,"url":"https://github.com/dotnettools/convertex","last_synced_at":"2025-09-18T07:30:46.677Z","repository":{"id":63312237,"uuid":"426231013","full_name":"dotnettools/ConvertEx","owner":"dotnettools","description":"A capable extension to System.Convert","archived":false,"fork":false,"pushed_at":"2023-01-13T23:59:42.000Z","size":55,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-13T23:47:32.355Z","etag":null,"topics":["conversion","dotnet","system-convert","type-conversion"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotnettools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-09T13:02:12.000Z","updated_at":"2023-03-12T14:04:03.000Z","dependencies_parsed_at":"2023-02-09T18:01:50.867Z","dependency_job_id":null,"html_url":"https://github.com/dotnettools/ConvertEx","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnettools%2FConvertEx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnettools%2FConvertEx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnettools%2FConvertEx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnettools%2FConvertEx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotnettools","download_url":"https://codeload.github.com/dotnettools/ConvertEx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233456287,"owners_count":18679005,"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","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":["conversion","dotnet","system-convert","type-conversion"],"created_at":"2025-01-11T08:18:29.034Z","updated_at":"2025-09-18T07:30:41.282Z","avatar_url":"https://github.com/dotnettools.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConvertEx\nConvertEx is a capable extension to `System.Convert`. It does its best to return a value instead of throwing exceptions.\n\n## Features\n- Supports `Nullable\u003cT\u003e` types.\n- Out-of-box converters for non-primitive types e.g. converts a string or number to `TimeSpan` and vice versa.\n- Supports custom converters to convert to and from any type.\n- Falls back to `System.Convert`, meaning that everything that `System.Convert` can do, `ConvertEx` does too.\n\n## \u003ca href=\"https://www.nuget.org/packages/ConvertEx\"\u003eNuGet Package\u003c/a\u003e\n\n```powershell\nInstall-Package ConvertEx -Version 1.0.5\n```\n\n## Usage Examples\n\n### Change type using default converter\n\n```csharp\nvar integer = ConvertEx.ChangeType(\"123\", typeof(int)); // integer = 123\nvar uri = ConvertEx.ChangeType(\"https://github.com/\", typeof(Uri)) // Works like a charm - No InvalidCastException!\n```\n\n### Convert nullables\n\n```csharp\nint? num = 5;\nvar dbl = ConvertEx.ChangeType\u003cdouble?\u003e(num); // dbl = 5d\n```\n\n### Create a custom converter\n\n```csharp\nvar converter = new TypeConverter()\n                .AddDigester\u003cNullableDigester\u003e()\n                .AddConverter\u003cNullableConverter\u003e()\n                .AddConverter\u003cToStringConverter\u003e()\n                .AddConverter\u003cTimeSpanConverter\u003e()\n                .AddConverter\u003cUriConverter\u003e()\n                .AddConverter\u003cSystemConverter\u003e();\n```\n\n**Note:** To write your own digesters or converters see source code for `ToStringConverter` and `NullableDigester`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnettools%2Fconvertex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotnettools%2Fconvertex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnettools%2Fconvertex/lists"}