{"id":23586745,"url":"https://github.com/davidrogersdev/businessvalidation","last_synced_at":"2025-05-07T07:47:11.961Z","repository":{"id":41255853,"uuid":"507185158","full_name":"DavidRogersDev/BusinessValidation","owner":"DavidRogersDev","description":"A very small library for performing validation in Business Services.","archived":false,"fork":false,"pushed_at":"2025-03-07T08:50:45.000Z","size":2335,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T05:24:19.286Z","etag":null,"topics":["csharp-library","csharp-validation","validation","validation-library","validator"],"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/DavidRogersDev.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":"2022-06-25T01:26:21.000Z","updated_at":"2025-02-25T02:23:43.000Z","dependencies_parsed_at":"2024-12-14T08:22:13.294Z","dependency_job_id":"660d3706-2fcb-4613-a570-06bd8e46a2be","html_url":"https://github.com/DavidRogersDev/BusinessValidation","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":0.02941176470588236,"last_synced_commit":"5dcfb7bc5dbdf66350d3524521389408ea5258b7"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidRogersDev%2FBusinessValidation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidRogersDev%2FBusinessValidation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidRogersDev%2FBusinessValidation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidRogersDev%2FBusinessValidation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidRogersDev","download_url":"https://codeload.github.com/DavidRogersDev/BusinessValidation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252839019,"owners_count":21812083,"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":["csharp-library","csharp-validation","validation","validation-library","validator"],"created_at":"2024-12-27T04:13:56.551Z","updated_at":"2025-05-07T07:47:11.952Z","avatar_url":"https://github.com/DavidRogersDev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NuGet](https://img.shields.io/nuget/v/BusinessValidation.svg?style=flat-square)](https://www.nuget.org/packages/BusinessValidation/) BusinessValidation  \n\n# BusinessValidation\nAn awfully small library for performing validation in Business Services.\n\n## Run Business Validation Rules\nA simple example:\n```csharp\nvar validator = new Validator();\n// basic validation. The checkRego method (last argument) would return a Boolean.\nvalidator.Validate(\"CarRegistration\", \"Vehicle does not have a current, valid registration\", checkRego(someVehicle));\n\nif(validator) {\n    var licensee = GetLicensee(licenceNr);\n\n    if(licensee is null) {\n        // add a raw message to the relevant Failure Bundle.\n        validator.AddFailure(\"Licensee\", $\"No licensee exists with the licence number {licenceNr}.\");\n    } else {\n        // validate an object\n        validator.Validate(l =\u003e l.DateOfBirth, $\"No valid date of birth is stored for the licensee with licence number {licenceNr}\", licensee, l =\u003e l.DateOfBirth \u003e DateTime.MinValue);\n    }    \n}    \nvalidator.ThrowIfInvalid(); // throws exception, only if IsValid() is false, which wraps the Validation Failures dictionary.\nreturn validator; // returns object which implicitly casts to \"true\" if valid. \n```\nMore example code can be found in the **sample** project in the repo code.\n## Read About it\nI wrote an article explaining the genesis and usage of Business Validation [here](https://medium.com/p/ef161bf5e3b9).\n\n## Build It\nYou can easily build the assembly by cloning the repository, changing to the root directory in a shell and running the following command:    \n`nuke Compile`  \nIf you also want to run the unit tests:  \n`nuke Test`  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidrogersdev%2Fbusinessvalidation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidrogersdev%2Fbusinessvalidation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidrogersdev%2Fbusinessvalidation/lists"}