{"id":20984726,"url":"https://github.com/prgfx/prgfx.objectutils","last_synced_at":"2025-09-19T22:36:21.554Z","repository":{"id":85552423,"uuid":"173605205","full_name":"PRGfx/Prgfx.ObjectUtils","owner":"PRGfx","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-03T20:31:05.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T07:14:35.797Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PRGfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-03T17:14:16.000Z","updated_at":"2019-03-03T20:31:06.000Z","dependencies_parsed_at":"2023-03-04T07:30:55.739Z","dependency_job_id":null,"html_url":"https://github.com/PRGfx/Prgfx.ObjectUtils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRGfx%2FPrgfx.ObjectUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRGfx%2FPrgfx.ObjectUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRGfx%2FPrgfx.ObjectUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRGfx%2FPrgfx.ObjectUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PRGfx","download_url":"https://codeload.github.com/PRGfx/Prgfx.ObjectUtils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243392315,"owners_count":20283563,"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":"2024-11-19T05:54:20.996Z","updated_at":"2025-09-19T22:36:16.487Z","avatar_url":"https://github.com/PRGfx.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prgfx.ObjectUtils\nPorts some functionality from [Neos Flow](https://flow.neos.io/) utilities to C#.\n\n## ObjectAccess\n(see [Neos.Utility.ObjectHandling](https://github.com/neos/flow-development-collection/tree/master/Neos.Utility.ObjectHandling))\nUtility to access properties of an object using getters, offset or (public) properties (or fields) as fit.\n```C#\n// get a property if available or throw Prgfx.ObjectUtils.PropertyNotAccessibleException\n// will check getters like GetPropertyName, HasPropertyName and IsPropertyName if necessary\nPrgfx.ObjectUtils.ObjectAccess.GetProperty(subject, \"propertyName\");\n// access non-public properties by forcing access\nPrgfx.ObjectUtils.ObjectAccess.GetProperty(subject, \"protectedProperty\", true);\n\n// get nested values by path\n// parts of a path are simply . separated and can access different kinds of data structures\nPrgfx.ObjectUtils.ObjectAccess.ObjectPropertyByPath(subject, \"list.2.dict.key\");\n```\n\n## PositionalCollectionSorter\n(see [Neos.Utility.Arrays](https://github.com/neos/flow-development-collection/tree/master/Neos.Utility.Arrays))\nUtility to primarily get the key of an enumerable data set ordered by a position-string:\n```\nstart (\u003cweight\u003e)\nend (\u003cweight\u003e)\nbefore \u003ckey\u003e (\u003cweight\u003e)\nafter \u003ckey\u003e (\u003cweight\u003e)\n\u003cnumerical-order\u003e\n```\nHere \"weight\" is the priority of items within a grouping, so `start` and `after` are sorted by descending weight, `end` and `before` by ascending weight.\n\nThe position-string will be determined by a property path (accessed with `ObjectAccess`), given as second argument when constructing the sorter and can thus be a nested property.\n```c#\nvar subject = new Dictionary\u003cstring, object\u003e{ \n    { \"key1\", new { position = \"start\" } },\n    { \"key2\", new { position = \"before key1\" } },\n    { \"key3\", new { position = \"after key2\" } }\n};\nvar sorter = new PositionalCollectionSorter(subject, \"position\");\nsorter.GetSortedKeys(); // {\"key2\", \"key3\", \"key1\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprgfx%2Fprgfx.objectutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprgfx%2Fprgfx.objectutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprgfx%2Fprgfx.objectutils/lists"}