{"id":22538407,"url":"https://github.com/shuttle/shuttle.core.contract","last_synced_at":"2025-10-16T02:52:05.520Z","repository":{"id":56075107,"uuid":"115493603","full_name":"Shuttle/Shuttle.Core.Contract","owner":"Shuttle","description":"Performs asserts/assumptions to prevent invalid code execution.","archived":false,"fork":false,"pushed_at":"2025-04-04T18:58:03.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T19:50:12.686Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shuttle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2017-12-27T07:19:32.000Z","updated_at":"2025-04-04T18:58:07.000Z","dependencies_parsed_at":"2024-06-21T02:36:59.347Z","dependency_job_id":"cd542bd7-3c50-4283-9d21-c012737b2d32","html_url":"https://github.com/Shuttle/Shuttle.Core.Contract","commit_stats":{"total_commits":15,"total_committers":3,"mean_commits":5.0,"dds":"0.19999999999999996","last_synced_commit":"a5a8fcdf8be2fd7e6c84d182e651c44f8ef9b544"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shuttle%2FShuttle.Core.Contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shuttle%2FShuttle.Core.Contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shuttle%2FShuttle.Core.Contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shuttle%2FShuttle.Core.Contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shuttle","download_url":"https://codeload.github.com/Shuttle/Shuttle.Core.Contract/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248104857,"owners_count":21048412,"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-12-07T11:11:57.004Z","updated_at":"2025-10-16T02:52:00.488Z","avatar_url":"https://github.com/Shuttle.png","language":"C#","readme":"# Shuttle.Core.Contract\r\n\r\n```\r\nPM\u003e Install-Package Shuttle.Core.Contract\r\n```\r\n\r\n\r\nA guard implementation that performs assertions/assumptions to prevent invalid code execution.\r\n\r\n# Guard\r\n\r\n```c#\r\nvoid Against\u003cTException\u003e(bool assertion, string message) where TException : Exception\r\n```\r\n\r\nThrows exception `TException` with the given `message` if the `assertion` is false.  If exception type `TException` does not have a constructor that accepts a `message` then an `InvalidOperationException` is thrown instead.\r\n\r\n---\r\n\r\n```c#\r\nstring AgainstEmpty(string? value, [CallerArgumentExpression(\"value\")] string? name = null)\r\n```\r\n\r\nThrows a `ArgumentNullException` if the given `value` is `null` or empty/whitespace; else returns the `value`.\r\n\r\n---\r\n\r\n```c#\r\nGuid AgainstEmpty(Guid value, [CallerArgumentExpression(\"value\")] string? name = null)\r\n```\r\n\r\nThrows and `ArgumentException` when the `value` is equal to an empty `Guid` (`{00000000-0000-0000-0000-000000000000}`); else returns the `value`.\r\n\r\n---\r\n\r\n```c#\r\nIEnumerable\u003cT\u003e AgainstEmpty\u003cT\u003e(IEnumerable\u003cT\u003e enumerable, [CallerArgumentExpression(\"enumerable\")] string? name = null)\r\n```\r\n\r\nThrows an `ArgumentException` if the given `enumerable` does not contain any entries; else returns the `enumerable`.\r\n\r\n---\r\n\r\n```c#\r\nT AgainstNull\u003cT\u003e(T? value, [CallerArgumentExpression(\"value\")] string? name = null)\r\n```\r\n\r\nThrows a `ArgumentNullException` if the given `value` is `null`; else returns the `value`.\r\n\r\n---\r\n\r\n```c#\r\nTEnum AgainstUndefinedEnum\u003cTEnum\u003e(object? value, [CallerArgumentExpression(\"value\")] string? name = null)\r\n```\r\n\r\nThrows an `InvalidOperationException` if the provided `value` cannot be found in the given `TEnum`; else returns the `value` as `TEnum`.\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuttle%2Fshuttle.core.contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuttle%2Fshuttle.core.contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuttle%2Fshuttle.core.contract/lists"}