{"id":28389370,"url":"https://github.com/dotnet-ad/Faker.Portable","last_synced_at":"2025-06-27T17:31:55.611Z","repository":{"id":27025102,"uuid":"30489681","full_name":"dotnet-ad/Faker.Portable","owner":"dotnet-ad","description":"C# faked data generation for testing and prototyping purpose.","archived":false,"fork":false,"pushed_at":"2019-07-17T15:09:35.000Z","size":113,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T10:44:15.859Z","etag":null,"topics":["data","fake","model","stub"],"latest_commit_sha":null,"homepage":null,"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/dotnet-ad.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}},"created_at":"2015-02-08T11:57:02.000Z","updated_at":"2023-02-01T21:46:16.000Z","dependencies_parsed_at":"2022-08-31T21:45:51.219Z","dependency_job_id":null,"html_url":"https://github.com/dotnet-ad/Faker.Portable","commit_stats":null,"previous_names":["aloisdeniel/faker.portable"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dotnet-ad/Faker.Portable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-ad%2FFaker.Portable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-ad%2FFaker.Portable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-ad%2FFaker.Portable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-ad%2FFaker.Portable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotnet-ad","download_url":"https://codeload.github.com/dotnet-ad/Faker.Portable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-ad%2FFaker.Portable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262301848,"owners_count":23290150,"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":["data","fake","model","stub"],"created_at":"2025-05-31T01:08:30.833Z","updated_at":"2025-06-27T17:31:55.602Z","avatar_url":"https://github.com/dotnet-ad.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Faker.Portable](Documentation/logo-wide.png)\n\nI wrote this library some time ago for helping me generating some faked data. It's a quick and ugly implementation at the moment, but it do the job pretty well for me.\n\n\n## Installation\n\nThe library is available as a PCL on [NuGet](https://www.nuget.org/packages/Faker.Portable/).\n\nTo install **Faker.Portable**, run the following command in the Package Manager Console.\n\n\tPM\u003e Install-Package Faker.Portable\n\n## Usage\n\n### Creation\n\nTo create a faked instance, simply call the `Create\u003cT\u003e` generic method, where `T` is the object type :\n\n\tvar value = Faker.Default.Create\u003cstring\u003e();\n\nYou can also add advice by adding a string : \n\n\tvar value = Faker.Default.Create\u003cstring\u003e(\"name\");\n\nFaker will generate *POCO* and each of its properties and use property name as the advice for generation :\n\n\tpublic class MyObject\n\t{\n\t\tpublic string Name { get; set; }\n\t\tpublic string Description { get; set; }\n\t\tpublic MyObject Child { get; set; }\n\t}\n\n\tvar value = Faker.Default.Create\u003cMyObject\u003e();\n\n**Note** : when a cycle exists (like `MyObject.Child` previous example), the faked data generation stops with a default depth of `10`. You can change this behavior by changing the `Faker.Default.MaxScope` property. \n\n### Customisation\n\nYou can register custom behaviors simply by calling the `Register\u003cT\u003e` generic methods :\n\t\n\tFaker.Default.Register\u003cstring\u003e(() =\u003e \"Faker.Portable\");\n\tvar value = Faker.Default.Create\u003cstring\u003e();\n\t// value == \"Faker.Portable\"\n\nYou can add add a condition regarding what the given advice should be :\n\n\tFaker.Default.Register\u003cstring\u003e(\"title\",() =\u003e \"Faker.Portable\");\n\tvar value = Faker.Default.Create\u003cstring\u003e(\"Title\");\n\t// value == \"Faker.Portable\"\n\nOr a lambda expression :\n\n\tFaker.Default.Register\u003cstring\u003e((a) =\u003e a.ToLower().Trim().Contains(\"title\"),() =\u003e \"Faker.Portable\");\n\tvar value = Faker.Default.Create\u003cstring\u003e(\"MainTitle\");\n\t// value == \"Faker.Portable\"\n\nAt any time you can remove your custom behaviors by calling `Faker.Default.Reset()` method.\n\n### Supported base types\n\nThe library currently supports those base types : `string`, `Uri`, `bool`, `char`, `enum`, `int`, `long`, `byte`, `DateTime`, `IDictionary\u003c,\u003e`, `double`,  `float`, `IEnumerable\u003c\u003e`, `List\u003c\u003e`, `List\u003c\u003e`, `Stack\u003c\u003e`, `ObservableCollection\u003c\u003e`, `Task`, `Task\u003c\u003e`.\n\n## Roadmap / ideas\n\n* Cleaning code and improving architecture.\n* Adding missing base types.\n* Adding more advices support.\n\n# Copyright and license\n\nCode and documentation copyright 2014-2015 Aloïs Deniel released under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet-ad%2FFaker.Portable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotnet-ad%2FFaker.Portable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet-ad%2FFaker.Portable/lists"}