{"id":25975257,"url":"https://github.com/pjc0247/ct","last_synced_at":"2025-07-24T07:40:39.156Z","repository":{"id":66066820,"uuid":"202282313","full_name":"pjc0247/ct","owner":"pjc0247","description":"Object Change Tracking in .NET","archived":false,"fork":false,"pushed_at":"2019-09-24T08:34:11.000Z","size":14,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-24T02:39:39.405Z","etag":null,"topics":["csharp","dotnet"],"latest_commit_sha":null,"homepage":"","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/pjc0247.png","metadata":{"files":{"readme":"readme.md","changelog":"ChangeTracker.sln","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,"zenodo":null}},"created_at":"2019-08-14T05:41:10.000Z","updated_at":"2024-11-22T06:39:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"8794377f-d969-4cf0-99aa-e93e28e639ff","html_url":"https://github.com/pjc0247/ct","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pjc0247/ct","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjc0247%2Fct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjc0247%2Fct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjc0247%2Fct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjc0247%2Fct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pjc0247","download_url":"https://codeload.github.com/pjc0247/ct/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjc0247%2Fct/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266808556,"owners_count":23987450,"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-24T02:00:09.469Z","response_time":99,"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","dotnet"],"created_at":"2025-03-05T02:38:25.075Z","updated_at":"2025-07-24T07:40:39.148Z","avatar_url":"https://github.com/pjc0247.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"ct\n====\nObject Change Tracking in .NET\n\n```cs\ninterface Item : IObserved {\n    int Quantity;\n    string Name;\n}\ninterface Player : IObserved {\n    string Name;\n    ICollection\u003cItem\u003e Items;\n}\n```\n\n__Property tracking__\n```cs\nvar player = ObservedEntity.Create\u003cPlayer\u003e();\nplayer.Name = \"John Doe\";\nplayer.HasChanges; // TRUE\n\nplayer.ConfirmChanges(); \nplayer.HasChanges; // FALSE\n```\n\n__Collection tracking__\n```cs\nvar item = ObservedEntity.Create\u003cItem\u003e();\nitem.Name = \"Sword\";\nitem.Quantity = 10;\nplayer.Items.Add(item);\nplayer.HasChanges; // TRUE\n```\n\n__Deep tracking (Tracking Graph)__\n```cs\nplayer.ConfirmChanges();\nplayer.HasChanges; // FALSE\n\nplayer.Items[0].Quantity = 15;\nplayer.HasChanges; // TRUE\n```\n\n__Change revisions__\n```cs\nvar rev = player.UncommitedRevision;\nforeach (var c in rev.Changes) \n    Console.WriteLine($\"{c.Key}, {c.Prev} =\u003e {c.After}\");\n\nvar revisions = player.Revisions;\nConsole.WriteLine(revisions.Revision); // Revision No.\n```\n\nPerformance Consideration\n----\n`IObserved` objects do more stuffs for tracking changes. It's definetly slower than non-tracking objects. Please be aware of the performance and do not use this for heavily changing objects. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjc0247%2Fct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjc0247%2Fct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjc0247%2Fct/lists"}