{"id":21699878,"url":"https://github.com/jonasraoni/csharp-variant-type","last_synced_at":"2025-07-26T13:32:52.010Z","repository":{"id":124279183,"uuid":"109189628","full_name":"jonasraoni/csharp-variant-type","owner":"jonasraoni","description":"A class that mimics the behavior of the so-called variant data type.","archived":false,"fork":false,"pushed_at":"2017-11-01T23:57:09.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T05:43:12.854Z","etag":null,"topics":["csharp","data-type","datatype","type","variant-data","variants"],"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/jonasraoni.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-01T22:14:28.000Z","updated_at":"2023-11-11T14:00:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"b2c5d971-3cd8-4bb1-8bb4-40b4458a74a0","html_url":"https://github.com/jonasraoni/csharp-variant-type","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonasraoni/csharp-variant-type","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasraoni%2Fcsharp-variant-type","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasraoni%2Fcsharp-variant-type/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasraoni%2Fcsharp-variant-type/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasraoni%2Fcsharp-variant-type/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonasraoni","download_url":"https://codeload.github.com/jonasraoni/csharp-variant-type/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasraoni%2Fcsharp-variant-type/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267174694,"owners_count":24047669,"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-26T02:00:08.937Z","response_time":62,"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":["csharp","data-type","datatype","type","variant-data","variants"],"created_at":"2024-11-25T20:11:55.703Z","updated_at":"2025-07-26T13:32:51.981Z","avatar_url":"https://github.com/jonasraoni.png","language":"C#","readme":"# C# Variant data type\n\nA class that mimics the behavior of the so-called variant data type.\n\nThe Variant class can be transparently assigned and converted to/from any basic data type (string, datetime, sbyte, byte, short, int, long, ushort, uint, ulong, float, double, bool, char, decimal as well as their nullable types).\n\nSee the file [test.cs](test.cs) to view the possibilities.\n\n```csharp\nvar v = new Variant(123);\nVariant v2 = 0;\nConsole.WriteLine(v == v2);\nConsole.WriteLine(v \u003e v2);\nConsole.WriteLine(v2 ? \"v2 converted to true\" : \"v2 converted to false\");\nConsole.WriteLine((int)v);\nConsole.WriteLine((bool)v);\nConsole.WriteLine((double)v);\nConsole.WriteLine(((int?)new Variant(null)).HasValue);\nConsole.WriteLine(((DateTime)new Variant(DateTime.Now)).ToString(\"o\"));\nConsole.WriteLine((bool)new Variant(\"False\"));\nConsole.WriteLine((float)new Variant(\"123.321\"));\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasraoni%2Fcsharp-variant-type","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasraoni%2Fcsharp-variant-type","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasraoni%2Fcsharp-variant-type/lists"}