{"id":27260651,"url":"https://github.com/openriaservices/openriaservices.fluentmetadata","last_synced_at":"2025-07-02T03:36:21.169Z","repository":{"id":54817165,"uuid":"186829613","full_name":"OpenRIAServices/OpenRiaServices.FluentMetadata","owner":"OpenRIAServices","description":"FluentMentadata is a Fluent API for defining metadata for Open RIA Services entities","archived":false,"fork":false,"pushed_at":"2022-10-27T12:24:41.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-15T08:17:11.617Z","etag":null,"topics":["dotnet","fluent","open-ria-services","wcf"],"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/OpenRIAServices.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-15T13:14:05.000Z","updated_at":"2022-10-26T20:23:51.000Z","dependencies_parsed_at":"2023-01-20T19:18:21.834Z","dependency_job_id":null,"html_url":"https://github.com/OpenRIAServices/OpenRiaServices.FluentMetadata","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/OpenRIAServices/OpenRiaServices.FluentMetadata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRIAServices%2FOpenRiaServices.FluentMetadata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRIAServices%2FOpenRiaServices.FluentMetadata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRIAServices%2FOpenRiaServices.FluentMetadata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRIAServices%2FOpenRiaServices.FluentMetadata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenRIAServices","download_url":"https://codeload.github.com/OpenRIAServices/OpenRiaServices.FluentMetadata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRIAServices%2FOpenRiaServices.FluentMetadata/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263071206,"owners_count":23409255,"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":["dotnet","fluent","open-ria-services","wcf"],"created_at":"2025-04-11T04:54:00.390Z","updated_at":"2025-07-02T03:36:21.146Z","avatar_url":"https://github.com/OpenRIAServices.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Build status\n[![Build Status](https://dev.azure.com/OpenRiaServices/OpenRiaServices/_apis/build/status/OpenRIAServices.OpenRiaServices.FluentMetadata?branchName=master)](https://dev.azure.com/OpenRiaServices/OpenRiaServices/_build/latest?definitionId=3\u0026branchName=master)\n\nSonarcloud status\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=OpenRIAServices_OpenRiaServices.FluentMetadata\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=OpenRIAServices_OpenRiaServices.FluentMetadata)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=OpenRIAServices_OpenRiaServices.FluentMetadata\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=OpenRIAServices_OpenRiaServices.FluentMetadata)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=OpenRIAServices_OpenRiaServices.FluentMetadata\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=OpenRIAServices_OpenRiaServices.FluentMetadata)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=OpenRIAServices_OpenRiaServices.FluentMetadata\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=OpenRIAServices_OpenRiaServices.FluentMetadata)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=OpenRIAServices_OpenRiaServices.FluentMetadata\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=OpenRIAServices_OpenRiaServices.FluentMetadata)\n\nNuget [![Nuget](https://img.shields.io/nuget/v/OpenRiaServices.FluentMetadata.svg)](https://www.nuget.org/packages/OpenRiaServices.FluentMetadata)\npreview [![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/OpenRiaServices.FluentMetadata.svg)](https://www.nuget.org/packages/OpenRiaServices.FluentMetadata)\n\n# OpenRiaServices.FluentMetadata\n\nFluentMentadata is a Fluent API for defining metadata for Open RIA Services entities\n\nWith permission of Nikhil Kothari, I've added the source code of Nikhil's Fluent API for defining WCF Ria Services Metadata to RIA Services Contrib. \nI've made a couple of changes. Most noticeable is the ability to attach a MetadataClass to your domain service using the FluentMetadata attribute. This class mimics the OnModelCreating method in EntityFramework DbContext and allows you to instantiate your Metadata classes. \nThe main advantage of this package is that it allows you to separate your datamodel and metadata in separate projects/assemblies. This is not possible with the standard RIA services approach of buddy classes. These have to be defined in the same project as your datamodel. The drawbacks of this are a pollution of your datamodel and (most importantly) that your datamodel project becomes dependent on RIA services-specific assemblies. With the FluentMetadata package you can define metadata in any assembly you like.\n\n## Download\nThe package is available as a [Nuget package](https://www.nuget.org/packages/OpenRiaServices.FluentMetadata).\n\n\nLast nuget release [![Nuget](https://img.shields.io/nuget/v/OpenRiaServices.FluentMetadata.svg)](https://www.nuget.org/packages/OpenRiaServices.FluentMetadata)\n\nLast preview release [![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/OpenRiaServices.FluentMetadata.svg)](https://www.nuget.org/packages/OpenRiaServices.FluentMetadata)\n\n\n## Using FluentMetadata\n* Install the FluentMetadata Nuget package (or download its source code)\n* Define a MetadataConfiguration class containing the fluent metadata for your entities. For example:\n\n```csharp\npublic class FluentMetadataConfiguration : IFluentMetadataConfiguration\n{\n    public void OnTypeCreation(MetadataContainer metadataContainer)\n    {\n        metadataContainer.Entity\u003cFoo\u003e().Projection(x =\u003e x.SomeProperty).Exclude();\n    }\n}\n```\n\n* Alternatively, you can define the metadata for each entity in separate MetadataClass classes. For example\n```csharp\npublic class FooMetadata : MetadataClass\u003cFoo\u003e\n{\n    public FooMetadata()\n    {\n        this.Projection(x =\u003e x.ExcludedString).Exclude();\n        this.Validation(x =\u003e x.RequiredString).Required();\n        this.Validation(x =\u003e x.RegularExpressionString).RegularExpression(\"[a-z](a-z)\");\n    }\n}\n```\n* ... and instantiate it from your FluentMetadataConfiguration  class, like so:\n```csharp\npublic class FluentMetadataConfiguration : IFluentMetadataConfiguration\n{\n    public void OnTypeCreation(MetadataContainer metadataContainer)\n    {\n        metadataContainer.Add(new FooMetadata());\n    }\n}\n```\n* ... both mechanisms can be combined.\n* Lastly, add the FluentMetadata attribute to your domain service:\n\n```csharp\n[EnableClientAccess()]\n[FluentMetadata(typeof(FluentMetadataConfiguration))]\npublic class FluentMetadataTestDomainService : DomainService\n{\n}\n```\n\n## Sample project\n\nLook into the FluentMetadata.Tests folder\n\n## Previous versions\n* The version for WCF Ria Services can be found in [riaservicescontrib\n](https://github.com/OpenRIAServices/riaservicescontrib)\n* The original version is available [here](http://www.nikhilk.net/RIA-Services-Fluent-Metadata-API.aspx).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenriaservices%2Fopenriaservices.fluentmetadata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenriaservices%2Fopenriaservices.fluentmetadata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenriaservices%2Fopenriaservices.fluentmetadata/lists"}