{"id":15039435,"url":"https://github.com/dimitrietataru/ace-csharp-data-faker","last_synced_at":"2026-02-25T22:05:00.860Z","repository":{"id":158507641,"uuid":"504148821","full_name":"dimitrietataru/ace-csharp-data-faker","owner":"dimitrietataru","description":"C# data faker","archived":false,"fork":false,"pushed_at":"2025-04-14T03:35:21.000Z","size":107,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"ace","last_synced_at":"2025-05-15T02:36:14.049Z","etag":null,"topics":["bogus","csharp","data-factory","data-faker","dot-net"],"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/dimitrietataru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-06-16T12:34:28.000Z","updated_at":"2025-04-14T03:35:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2266fd8-7833-4cc0-bb9c-24ce5ee00fa3","html_url":"https://github.com/dimitrietataru/ace-csharp-data-faker","commit_stats":{"total_commits":51,"total_committers":2,"mean_commits":25.5,"dds":0.05882352941176472,"last_synced_commit":"0483c22aa7b310561084b0c0f9c81d00ab2e8e57"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/dimitrietataru/ace-csharp-data-faker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrietataru%2Face-csharp-data-faker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrietataru%2Face-csharp-data-faker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrietataru%2Face-csharp-data-faker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrietataru%2Face-csharp-data-faker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimitrietataru","download_url":"https://codeload.github.com/dimitrietataru/ace-csharp-data-faker/tar.gz/refs/heads/ace","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrietataru%2Face-csharp-data-faker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29842916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T21:18:31.832Z","status":"ssl_error","status_checked_at":"2026-02-25T21:18:29.265Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bogus","csharp","data-factory","data-faker","dot-net"],"created_at":"2024-09-24T20:42:48.964Z","updated_at":"2026-02-25T22:05:00.842Z","avatar_url":"https://github.com/dimitrietataru.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C# data faker\n\n[![build](https://github.com/dimitrietataru/ace-csharp-data-faker/actions/workflows/build.yml/badge.svg)](https://github.com/dimitrietataru/ace-csharp-data-faker/actions/workflows/build.yml)\n[![release](https://github.com/dimitrietataru/ace-csharp-data-faker/actions/workflows/release.yml/badge.svg)](https://github.com/dimitrietataru/ace-csharp-data-faker/actions/workflows/release.yml)\n[![NuGet](https://img.shields.io/nuget/v/AceCSharp.DataFaker)](https://www.nuget.org/packages/AceCSharp.DataFaker)\n\n### What is AceCSharp.DataFaker\nIt's a library, that wraps around Bogus, built to easily generate fake data using a syntactic sugar syntax (_Fake.Of\\\u003cX\\\u003e()_).  \nTo configure how the Foo type is generated, add a new __private static property__ named _FakeFoo_. Relies on __duck-typing__ and uses _Reflection_ to find and use the appropriate configuration.  \nThe Bogus complex configuration is seggregated from its usage.  \n\n### Setup\n``` csharp\npublic class Foo\n{\n    public Guid Id { get; set; }\n    public string Title { get; set; }\n    public int Index { get; set; }\n    public bool IsActive { get; set; }\n}\n\npublic class FakeDto\n{\n    private static Faker\u003cFoo\u003e FakeFoo =\u003e\n        new Faker\u003cFoo\u003e()\n            .RuleFor(\n                foo =\u003e foo.Id,\n                func =\u003e func.Random.Uuid())\n            .RuleFor(\n                foo =\u003e foo.Title,\n                func =\u003e func.Lorem.Sentence())\n            .RuleFor(\n                foo =\u003e foo.Index,\n                func =\u003e func.Random.Int(min: 1, max: int.MaxValue))\n            .RuleFor(\n                foo =\u003e foo.IsActive,\n                func =\u003e func.Random.Bool())\n            .StrictMode(ensureRulesForAllProperties: true);\n}\n```\n\n### Usage\n``` csharp\nvar foo = Fake.Of\u003cFoo, FakeDto\u003e();\nvar threeFoos = Fake.ManyOf\u003cFoo, FakeDto\u003e(count: 3);\nvar manyFoos = Fake.ManyOf\u003cFoo, FakeDto\u003e(minCount: 10, maxCount: 100);\n```\n\n---\n\n### Extend your container\n``` csharp\npublic class FakeDto\n{\n    // ...\n\n    public static T Of\u003cT\u003e()\n        where T : class\n    {\n        return Fake.Of\u003cT, FakeDto\u003e();\n    }\n\n    public static List\u003cT\u003e ManyOf\u003cT\u003e(int count = 3)\n        where T : class\n    {\n        return Fake.ManyOf\u003cT, FakeDto\u003e(count);\n    }\n\n    public static List\u003cT\u003e ManyOf\u003cT\u003e(int minCount, int maxCount)\n        where T : class\n    {\n        return Fake.ManyOf\u003cT, FakeDto\u003e(minCount, maxCount);\n    }\n\t\n    // ...\n}\n```\n\n### Usage\n``` csharp\nvar foo = FakeDto.Of\u003cFoo\u003e();\nvar threeFoos = FakeDto.ManyOf\u003cFoo\u003e(count: 3);\nvar manyFoos = FakeDto.ManyOf\u003cFoo\u003e(minCount: 10, maxCount: 100);\n```\n\n---\n\n### What if I don't have a configuration?\nUse one of the `..OrDefault` methods. It will try to find the _FakeBar_ configuration, otherwise return the default _Faker\\\u003cBar\\\u003e_ instance.\n* OfOrDefault\n* ManyOfOrDefault\n``` csharp\n// When you did not configure the FakeDto class\nvar bar = Fake.Of\u003cBar\u003e();\n\n// When you did not configure the FakeBar property\nvar bar = Fake.OfOrDefault\u003cBar, FakeDto\u003e();\n```\n\n---\n\n### See also\n* [Bogus](https://github.com/bchavez/Bogus)\n\n### License\nAceCSharp.DataFaker is Copyright © 2022 [Dimitrie Tataru](https://github.com/dimitrietataru) and other contributors under the [MIT license](https://github.com/dimitrietataru/ace-csharp-data-faker/blob/ace/LICENSE.txt).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitrietataru%2Face-csharp-data-faker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimitrietataru%2Face-csharp-data-faker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitrietataru%2Face-csharp-data-faker/lists"}