{"id":16678907,"url":"https://github.com/joncloud/rlx-net","last_synced_at":"2025-08-18T13:32:46.533Z","repository":{"id":78825308,"uuid":"111241364","full_name":"joncloud/rlx-net","owner":"joncloud","description":"Adds functional programming aspects using functions like Some, None, Ok, Error","archived":false,"fork":false,"pushed_at":"2020-06-12T04:13:36.000Z","size":90,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"publish","last_synced_at":"2025-08-04T03:37:15.480Z","etag":null,"topics":["error-handling","functional","null","option","result","rustlang"],"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/joncloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2017-11-18T21:38:06.000Z","updated_at":"2019-01-24T20:19:52.000Z","dependencies_parsed_at":"2023-06-03T02:00:28.311Z","dependency_job_id":null,"html_url":"https://github.com/joncloud/rlx-net","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/joncloud/rlx-net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Frlx-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Frlx-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Frlx-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Frlx-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joncloud","download_url":"https://codeload.github.com/joncloud/rlx-net/tar.gz/refs/heads/publish","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Frlx-net/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270335938,"owners_count":24566756,"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-08-13T02:00:09.904Z","response_time":66,"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":["error-handling","functional","null","option","result","rustlang"],"created_at":"2024-10-12T13:31:57.233Z","updated_at":"2025-08-18T13:32:46.525Z","avatar_url":"https://github.com/joncloud.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rlx.NET\n[![Travis](https://img.shields.io/travis/joncloud/rlx-net.svg)](https://travis-ci.org/joncloud/rlx-net/)\n[![NuGet](https://img.shields.io/nuget/v/Rlx.svg)](https://www.nuget.org/packages/Rlx/)\n\n## Description\nRlx.NET provides core helper functions for abstracting null-references and errors. Rlx itself is short for `Rust Language Extensions`.\n\nIt was heavily inspired by the [Rust] programming language [Option] and [Result] types. \n\n## Licensing\nReleased under the MIT License.  See the [LICENSE][] file for further details.\n\n[license]: LICENSE.md\n\n## Installation\nIn the Package Manager Console execute\n\n```powershell\nInstall-Package Rlx\n```\n\nOr update `*.csproj` to include a dependency on\n\n```xml\n\u003cItemGroup\u003e\n  \u003cPackageReference Include=\"Rlx\" Version=\"0.2.1-*\" /\u003e\n\u003c/ItemGroup\u003e\n```\n\n## Usage\nSample echo program:\n```csharp\nusing Rlx;\n\nstatic void Main(string[] args) {\n  string message = args.ElementAtOrDefault(0)\n    .ToOption()\n    .MapOrElse(() =\u003e \"Missing Argument\", msg =\u003e $\"Echo: {msg}\");\n  \n  Console.WriteLine(message);\n}\n```\n\nNeed to generically handle exceptions? Wrap up logic with `TryFunctions`:\n```csharp\nusing System.IO;\nusing static Rlx.Functions;\n\npublic class MyClass\n{\n  public static void Unsafe() =\u003e\n    throw new NotImplementedException();\n\n  public static Result\u003cUnit, Exception\u003e Safe() =\u003e\n    Try(Unsafe);\n\n  public static Result\u003cUnit, IOException\u003e IOSafe() =\u003e\n    Try(Unsafe).Catch\u003cIOException\u003e();\n}\n```\n\nAnd also MVC helpers:\n```csharp\nusing Rlx;\nusing Rlx.MvcCore;\nusing static Rlx.Functions;\n\ninterface IDataService {\n  OptionTask\u003cData\u003e LoadDataAsync(Guid id);\n  ResultTask\u003cData, string\u003e UpdateDataAsync(Data data);\n}\n\nclass DataController : Controller {\n  readonly IDataService _dataService;\n  public DataController(IDataService dataService) =\u003e\n    _dataService = dataService;\n\n  public Task\u003cIActionResult\u003e Get(Guid id) =\u003e\n    WithErrors().AndThen(_ =\u003e _dataService.LoadDataAsync(id))\n      .ToActionResult();\n\n  public Task\u003cIActionResult\u003e Post([FromModel]Data data) =\u003e\n    WithErrors().AndThen(_ =\u003e _dataService.UpdateDataAsync(data))\n      .ToActionResult(_ =\u003e 200, _ =\u003e 400, x =\u003e Some(x));\n\n  Result\u003cUnit, string\u003e WithErrors() =\u003e\n    ModelState.ToResult().MapError(x =\u003e \"Bad Request\");\n}\n```\n\nFor additional usage see [Tests][] and [MVC Tests][].\n\n[Tests]: tests/Rlx.Tests\n[MVC Tests]: tests/Rlx.MvcCore/Tests\n[Rust]: https://www.rust-lang.org/\n[Option]: https://doc.rust-lang.org/std/option/\n[Result]: https://doc.rust-lang.org/std/result/index.html","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncloud%2Frlx-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoncloud%2Frlx-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncloud%2Frlx-net/lists"}