{"id":25127866,"url":"https://github.com/remora/remora.extensions.options.immutable","last_synced_at":"2025-04-23T14:35:28.504Z","repository":{"id":83764226,"uuid":"394070879","full_name":"Remora/Remora.Extensions.Options.Immutable","owner":"Remora","description":"An extension to Microsoft.Extensions.Options that allows the use of immutable option types.","archived":false,"fork":false,"pushed_at":"2025-02-13T13:07:29.000Z","size":135,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T09:58:52.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Remora.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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}},"created_at":"2021-08-08T21:12:47.000Z","updated_at":"2025-02-13T13:07:33.000Z","dependencies_parsed_at":"2024-03-31T13:29:20.553Z","dependency_job_id":"54a67bea-13f2-485e-a9fa-be830ca0f781","html_url":"https://github.com/Remora/Remora.Extensions.Options.Immutable","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Remora%2FRemora.Extensions.Options.Immutable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Remora%2FRemora.Extensions.Options.Immutable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Remora%2FRemora.Extensions.Options.Immutable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Remora%2FRemora.Extensions.Options.Immutable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Remora","download_url":"https://codeload.github.com/Remora/Remora.Extensions.Options.Immutable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250452967,"owners_count":21433119,"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":[],"created_at":"2025-02-08T11:19:38.021Z","updated_at":"2025-04-23T14:35:28.483Z","avatar_url":"https://github.com/Remora.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Remora.Extensions.Options.Immutable\n===================================\nThis package provides an extension to `Microsoft.Extensions.Options`, allowing \nthe use of immutable types (such as `record`s) in the options ecosystem.\n\nThe extension takes a simple and direct approach to integration with the \nexisting Microsoft-provided extension, adding only the minimal API necessary to\nachieve feature parity.\n\n# Usage\nUsage is simple - immutable option types may be configured in a practically \nidentical manner to mutable types, provided one of the following conditions are \ntrue:\n\n  * The type defines a parameterless constructor\n  * The type defines a constructor where all arguments are optional\n  * The type is explicitly initialized with a root state\n\nThat is, given the following types,\n\n```c#\npublic record ExplicitOptions(string Value, bool Flag);\npublic record ParameterlessOptions()\n{\n    public string? Value { get; init; }\n}\npublic record AllOptionalOptions(string Value = \"initial\", bool Flag = true\");\n```\n\nthey may be utilized in the following manner:\n\n```c#\nvar services = new ServiceCollection()\n    .Configure(() =\u003e new ExplicitOptions(\"initial\", true))\n    .Configure\u003cExplicitOptions\u003e(opt =\u003e opt with { Flag = false });\n\nvar services = new ServiceCollection()\n    .Configure\u003cParameterlessOptions\u003e(opt =\u003e opt with { Value = \"configured\" });\n\nvar services = new ServiceCollection()\n    .Configure\u003cAllOptionalOptions\u003e(opt =\u003e opt with { Flag = false });\n```\n\nAll the various normal configuration calls, such as `Configure`, \n`PostConfigure`, `ConfigureAll`, and `PostConfigureAll` (along with their named)\nvariants are supported.\n\n# Installation\nGet it on [NuGet][1]!\n\n\n[1]: https://www.nuget.org/packages/Remora.Extensions.Options.Immutable\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremora%2Fremora.extensions.options.immutable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremora%2Fremora.extensions.options.immutable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremora%2Fremora.extensions.options.immutable/lists"}