{"id":29690265,"url":"https://github.com/oliverzick/delizious-toolkit","last_synced_at":"2026-05-15T12:32:56.425Z","repository":{"id":55372339,"uuid":"287359651","full_name":"oliverzick/Delizious-Toolkit","owner":"oliverzick","description":"An easy to use .NET library that provides matching of values and decision trees.","archived":false,"fork":false,"pushed_at":"2021-02-16T20:21:13.000Z","size":123,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T09:29:11.895Z","etag":null,"topics":["c-sharp","csharp","decision","decision-making","decision-tree","decision-trees","decisions","dotnet","dotnet-standard","filtering","match","matching","toolkit"],"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/oliverzick.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-08-13T19:05:33.000Z","updated_at":"2021-01-04T21:39:16.000Z","dependencies_parsed_at":"2022-08-14T22:42:22.691Z","dependency_job_id":null,"html_url":"https://github.com/oliverzick/Delizious-Toolkit","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/oliverzick/Delizious-Toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverzick","download_url":"https://codeload.github.com/oliverzick/Delizious-Toolkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Toolkit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266626115,"owners_count":23958344,"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-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["c-sharp","csharp","decision","decision-making","decision-tree","decision-trees","decisions","dotnet","dotnet-standard","filtering","match","matching","toolkit"],"created_at":"2025-07-23T06:06:32.503Z","updated_at":"2026-05-15T12:32:56.235Z","avatar_url":"https://github.com/oliverzick.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Delizious Toolkit\n## What?\nDelizious Toolkit is an easy to use .NET library entirely written in C# that contains solutions to requirements I have faced in my (professional) life and provides ready-to-use components. I always strive for well-crafted and clean code with a solid API design (e.g. prefer composition over inheritance and favor factory methods over using constructors) and focus on object-functional programming paradigm. \n\nFurther things to mention:\n* Implementation is mostly based on [immutability](https://blogs.msdn.microsoft.com/ericlippert/2007/11/13/immutability-in-c-part-one-kinds-of-immutability/) and value semantics where applicable and useful\n* Separation of object graph construction and application logic as discussed [here](http://googletesting.blogspot.de/2008/08/by-miko-hevery-so-you-decided-to.html) (by the way a very interesting article about writing testable code!)\n\nIf you like or use my work and you are interested in this kind of software development let's get in touch. :)\n\n# Features\n## Overview\nDelizious Toolkit provides the following features:\n* [Matching of values](#matching-of-values) that is adopted from [Delizious Filtering](https://github.com/oliverzick/Delizious-Filtering) library\n* [Decision trees](#decision-trees)\n\nUpcoming features:\n* Undo-Redo engine that is adopted from [ImmutableUndoRedo](https://github.com/oliverzick/ImmutableUndoRedo) library\n\n## Matching of values\nIf you want to get rid of procedural and complex `if-the-else` and `switch` statements to evaluate and match values, the `Match` type is what you are looking for. It lets you easily define value matches in a declarative, configurable and extensible way and comes with the following strategies:\n\nMatch | What\n----- | --------\n`Always` | Matches always no matter what value is matched\n`Never` | Matches never no matter what value is matched\n`Null` | Matches when a value is a `null` reference\n`NotNull` | Matches when a value is not a `null` reference\n`Same` | Matches when a value is the same instance the match was given\n`NotSame` | Matches when a value is not the same instance the match was given\n`Equal` | Matches when a value equals an expected value the match was given (uses equality comparison)\n`NotEqual` | Matches when a value does not equal an expected value the match was given (uses equality comparison)\n`EqualTo` | Matches when a value is equal to an expected value the match was given (uses comparison)\n`NotEqualTo` | Matches when a value is not equal to an expected value the match was given (uses comparison)\n`GreaterThan` | Matches when a value is greater than an expected value the match was given (uses comparison)\n`GreaterThanOrEqualTo` | Matches when a value is greater than or equal to an expected value the match was given (uses comparison)\n`LessThan` | Matches when a value is less than an expected value the match was given (uses comparison)\n`LessThanOrEqualTo` | Matches when a value is less than or equal to an expected value the match was given (uses comparison)\n`All` | Matches when a value matches all of the given matches\n`Any` | Matches when a value matches any of the given matches\n`None` | Matches when a value matches none of the given matches\n`Except` | (**obsolete**) Matches when a value matches none of the given matches\n`Custom` | Matches when a value matches the given custom match\n`Transform` | Transforms a current value into a transformed value first and then matches the transformed value with a given match\n\n### Sample\nThe following sample shows the use of composition to combine different matches:\n\n```csharp\n// Match when value \u003c= -1 or value == 2 or (value =\u003e 4 and value \u003c 7) or value \u003e 10\nvar match = Match.Any(Match.LessThanOrEqualTo(-1),\n                      Match.EqualTo(2),\n                      Match.All(Match.GreaterThanOrEqualTo(4),\n                                Match.LessThan(7)),\n                      Match.GreaterThan(10));\n\nvar values = Enumerable.Range(-5, 20);\n\nConsole.WriteLine(\"Match when value \u003c= -1 or value == 2 or (value =\u003e 4 and value \u003c 7) or value \u003e 10\");\n\nforeach (var value in values)\n{\n    var result = match.Matches(value);\n\n    Console.WriteLine($\"Match value {value}: {result}\");\n}\n\n/* Output:\n\nMatch when value \u003c= -1 or value == 2 or(value =\u003e 4 and value \u003c 7) or value \u003e 10\nMatch value -5: True\nMatch value -4: True\nMatch value -3: True\nMatch value -2: True\nMatch value -1: True\nMatch value 0: False\nMatch value 1: False\nMatch value 2: True\nMatch value 3: False\nMatch value 4: True\nMatch value 5: True\nMatch value 6: True\nMatch value 7: False\nMatch value 8: False\nMatch value 9: False\nMatch value 10: False\nMatch value 11: True\nMatch value 12: True\nMatch value 13: True\nMatch value 14: True\n\n*/\n```\n\n## Decision trees\nMaking decisions that goes beyond a boolean result provided by [matching of values](#matching-of-values) is where [decision trees](https://en.wikipedia.org/wiki/Decision_tree) come into the game. This library provides an implementation of a generic `DecisionTree` that supports `Composite`, `Decision` and `Result` nodes. You can specify both the decision trees context that is used to make decisions and the result it provides. Decisions are specified by matches using a given context.\n\n### Sample\n```csharp\nenum CarType\n{\n    CityCar,\n    Subcompact,\n    Compact,\n    MidSize,\n    FullSize\n}\n\nclass Customer\n{\n    public int Age { get; set; }\n\n    public int Budget { get; set; }\n\n    public override string ToString()\n        =\u003e $\"Age: {this.Age}, Budget: {this.Budget}\";\n}\n\nstatic Match\u003cCustomer\u003e MatchProperty\u003cT\u003e(Func\u003cCustomer, T\u003e value, Match\u003cT\u003e match)\n    =\u003e Match.Transform(value, match);\n\nvar decisionTree = DecisionTree.Composite(DecisionTree.Decision(MatchProperty(s =\u003e s.Budget,\n                                                                              Match.LessThan(8000)),\n                                                                DecisionTree.Result\u003cCustomer, CarType\u003e(CarType.CityCar)),\n\n                                          DecisionTree.Decision(Match.Any(MatchProperty(s =\u003e s.Age,\n                                                                                        Match.LessThanOrEqualTo(21)),\n                                                                          MatchProperty(s =\u003e s.Budget,\n                                                                                        Match.LessThan(10000))),\n                                                                DecisionTree.Result\u003cCustomer, CarType\u003e(CarType.Subcompact)),\n\n                                          DecisionTree.Decision(Match.Always\u003cCustomer\u003e(),\n                                                                DecisionTree.Result\u003cCustomer, CarType\u003e(CarType.Compact)),\n\n                                          DecisionTree.Decision(Match.Any(\n                                                                          MatchProperty(s =\u003e s.Age,\n                                                                                        Match.GreaterThanOrEqualTo(25)),\n                                                                          MatchProperty(s =\u003e s.Budget,\n                                                                                        Match.GreaterThanOrEqualTo(25000))),\n                                                                DecisionTree.Result\u003cCustomer, CarType\u003e(CarType.MidSize)),\n\n                                          DecisionTree.Decision(MatchProperty(s =\u003e s.Budget,\n                                                                              Match.GreaterThanOrEqualTo(50000)),\n                                                                DecisionTree.Result\u003cCustomer, CarType\u003e(CarType.FullSize))\n                                         );\n\nvar customers = new[]\n                {\n                    new Customer { Age = 18, Budget = 7999 },\n                    new Customer { Age = 18, Budget = 12000 },\n                    new Customer { Age = 21, Budget = 25000 },\n                    new Customer { Age = 22, Budget = 9999 },\n                    new Customer { Age = 22, Budget = 10000 },\n                    new Customer { Age = 24, Budget = 24999 },\n                    new Customer { Age = 24, Budget = 25000 },\n                    new Customer { Age = 25, Budget = 24999 },\n                    new Customer { Age = 50, Budget = 9999 },\n                    new Customer { Age = 50, Budget = 50000 },\n                };\n\nforeach (var customer in customers)\n{\n    var recommendedCarTypes = decisionTree.All(customer);\n\n    var recommendations = string.Join(\", \", recommendedCarTypes);\n\n    Console.WriteLine($\"{customer} = {recommendations}\");\n}\n\n/* Output:\n\nAge: 18, Budget: 12000 = Subcompact, Compact\nAge: 21, Budget: 25000 = Subcompact, Compact, MidSize\nAge: 22, Budget: 9999 = Subcompact, Compact\nAge: 22, Budget: 10000 = Compact\nAge: 24, Budget: 24999 = Compact\nAge: 24, Budget: 25000 = Compact, MidSize\nAge: 25, Budget: 24999 = Compact, MidSize\nAge: 50, Budget: 9999 = Subcompact, Compact, MidSize\nAge: 50, Budget: 50000 = Compact, MidSize, FullSize\n\n*/\n```\n\n## License information\n```\nMIT License\n\nCopyright (c) 2020-2021 Oliver Zick\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverzick%2Fdelizious-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverzick%2Fdelizious-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverzick%2Fdelizious-toolkit/lists"}