DataAnnotationsExtensions | Validation extensions for DataAnnotations | Model View Controller library
kandi X-RAY | DataAnnotationsExtensions Summary
kandi X-RAY | DataAnnotationsExtensions Summary
This project provides common validation attributes (full list on the project website) which extend the built-in ASP.NET DataAnnotations (Required, Range, RegularExpression and StringLength). The core library provides server-side validation attributes that can be used in any .NET 4.0 or 4.5 project (no MVC dependency). There is also an easily pluggable client-side validation library which can be used in ASP.NET MVC 3 or 5 projects using unobtrusive jquery validation (only MVC included javascript files are required). All validation attributes are covered with unit tests and also have a dedicated controller in the included sample website (click Demos to see a demonstration of each validation attribute). Please see the project website for details:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DataAnnotationsExtensions
DataAnnotationsExtensions Key Features
DataAnnotationsExtensions Examples and Code Snippets
Community Discussions
Trending Discussions on DataAnnotationsExtensions
QUESTION
I have an N-Tier solution. It has four projects as shown below:
- Infrastructure (Model class)
- Repository
- Service (WCF)
- Web (Presentation)
The infrastructure takes care of the model classes
Infrastructure
...ANSWER
Answered 2017-Sep-22 at 14:56A key bit of information you have left out is how you imported your service reference into you Presentation project.
I am going to assume for the time being that you used the Service Reference wizard - this is what is causing your issue. When you use the provided wizard, visual studio looks at the hosted WSDL definition for your WCF service and auto generates new proxy and data contracts in the project you are working in. WSDLs do not support the data annotations you used and therefor are not copied over to the new contracts defined in the presentation project.
To fix this you have two options.
1) Navigate to the auto generated classes in your Presentation project and mark them up. Obviously this will lead to duplication of code in the long run and is not the most ideal.
2) Reference your data contracts and service contracts by DLL and write your own proxy class that inherits from ClientBase. You can find more details about that here: Create WCF Client without auto generated proxy.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DataAnnotationsExtensions
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page