{"id":20260773,"url":"https://github.com/independer/wcfdataannotations","last_synced_at":"2025-04-11T01:41:38.264Z","repository":{"id":53018228,"uuid":"117553783","full_name":"Independer/wcfdataannotations","owner":"Independer","description":"This repository is a fork of DevTrends WCF DataAnnotations","archived":false,"fork":false,"pushed_at":"2021-04-09T13:01:11.000Z","size":4066,"stargazers_count":6,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-28T05:44:42.925Z","etag":null,"topics":["annotations","dataannotations","validation","wcf"],"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/Independer.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":"2018-01-15T14:12:08.000Z","updated_at":"2021-04-09T13:01:13.000Z","dependencies_parsed_at":"2022-09-08T10:24:16.281Z","dependency_job_id":null,"html_url":"https://github.com/Independer/wcfdataannotations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Independer%2Fwcfdataannotations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Independer%2Fwcfdataannotations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Independer%2Fwcfdataannotations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Independer%2Fwcfdataannotations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Independer","download_url":"https://codeload.github.com/Independer/wcfdataannotations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248327443,"owners_count":21085251,"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":["annotations","dataannotations","validation","wcf"],"created_at":"2024-11-14T11:22:13.202Z","updated_at":"2025-04-11T01:41:38.231Z","avatar_url":"https://github.com/Independer.png","language":"C#","readme":"# WCF Data Annotations - Extended, signed [![NuGet](https://img.shields.io/nuget/v/Independer.WCFDataAnnotations.svg)](https://www.nuget.org/packages/Independer.WCFDataAnnotations) \n\nWCFDataAnnotations allows you to automatically validate WCF service operation arguments using the attributes and IValidatableObject interface from System.ComponentModel.DataAnnotations.\n\n## The purpose of this fork\nThe original version by DevTrends was a great starting point, however we needed some extra features like logging the validation exceptions and possibility of explicitly marking arguments allowing null to be passed to. \n\nThe original source is still available on CodePlex, however CodePlex will be stopped and is in readonly mode already.\n\nTo continue this great initiative, we copied the CodePlex repository to GitHub and made our changes available for everyone.\n\n## Improvements\nThe original validation logic doesn't cover every scenario:\n* Nested IValidatableObjects (also within IEnumerables)\n* Custom Validation Attributes\n\nThese issues have been fixed.\n\n## New features\n\n### IValidationResultsLogger\nIf you want to log the validation errors in your application you can add your implementation of the `IValidationResultsLogger`, so you can keep track of possible issues or mismatches between your client and server side validation.\n\n#### Usage\nAfter implementing the `IValidationResultsLogger` interface, all you need to do is defining that type for the `ValidateDataAnnotationsBehavior` attribute.\n\nE.g.:\n```csharp\n[ValidateDataAnnotationsBehavior(typeof(ValidationResultsLogger))]\npublic class TestService : ITestService {\n\n}\n```\n\n### [AllowNull] attribute\nThe library has a default null check which is performed always, \nregardless of the types of the arguments and therefor also for types that normally could have a null value (e.g.: classes, nullable types), \nbut due to this restriction it is not possible to call any WCF method with null as argument. Even if the code could/should accept null values.\n\nIn general this restriction is fine to have, but in some cases it would be handy if we could override this behavior explicitly on certain arguments.\n\n#### Usage\nUsage is very simple, if you want to make one of your arguments nullable, just add the data annotation `[AllowNull]` to the argument in the interface of your wcf service. It is important to do that in the interface (ServiceContract) and not in the class itself, otherwise it won't work.\n\n```csharp\n[ServiceContract]\npublic interface ITestService {\n\n  [OperationContract]\n  string GetData(int value);\n\n  [OperationContract]\n  CompositeType GetDataUsingDataContract(CompositeType composite, [AllowNull] CompositeType nullableType);\n}\n```\n\n## Strong Named (signed) version [![NuGet](https://img.shields.io/nuget/v/Independer.WCFDataAnnotations-Signed.svg)](https://www.nuget.org/packages/Independer.WCFDataAnnotations-Signed)\nThere is a signed version also available on NuGet which is identical to the normal package in terms of source code.\n\nThe `PublicKeyToken` of the signed version is: `656e010cba88e92b`\n\n### Update (v1.3.0)\nThe original version of this package has been started as a non signed package and later on we introduced a signed version of it as a separate package with the only difference of having it signed.\n\nWe don't see any reason to keep these two versions as separate packages, so decided that we sign the main package also.\n\nTherefore, from version `1.3.0` there is no point in keeping the `Independer.WCFDataAnnotations-Signed` package maintained anymore.\n\nIf you used that package previously, you can migrate and continue using the main package (`Independer.WCFDataAnnotations`) instead. \n\n\n## Version history\n\n * 1.3.0 \n   * Enhancements:\n     * Package is now signed\n     * Migrated project to SDK-style\n     * Target framework changes: \n       * Update .NET 4.5.1 target framework to .NET 4.7.2 \n       * Add netstandard2.0 target for limited dotnetcore support ( validation logic, no WCF )\n     * Added dotnet-pack.ps1 script. Usage: dotnet-pack.ps1 -signingKeyPath [PATH-TO-SNK-FILE]\n\n * 1.2.0.1 (Only for the Strong Named version)\n   * 1.2.0 for Strong Named Nuget feed was published accidentally without being signed, so published 1.2.0.1 signed\n\n * 1.2.0 \n   * Bug fixes: \n     * Fixed issue regarding using multiple endpoints with the same contract\n     \n * 1.1.0 \n   * Bug fixes: \n     * Fixed issue when injecting behavior with ServiceConfiguration in code\n     \n   * Enhancements: \n     * Added parameter name to validation results when missing \n     * Namespace change for better recognition of the fork in code\n      \n * 1.0.0 \n   * Initial version\n\n## Credit\nThis repository is a fork of the DevTrends WCF DataAnnotations repository (https://wcfdataannotations.codeplex.com/ (https://archive.codeplex.com/?p=wcfdataannotations))\n\nFor more information about how DevTrends WCF Data Annotations worked and the design decisions behind it, please visit the: https://www.devtrends.co.uk/blog/validating-wcf-service-operations-using-system.componentmodel.dataannotations\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findepender%2Fwcfdataannotations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findepender%2Fwcfdataannotations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findepender%2Fwcfdataannotations/lists"}