Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5929713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:27:29+00:00 2026-05-22T14:27:29+00:00

I am trying to seperate DataAnnotations from our POCOs within a Silverlight project. One

  • 0

I am trying to seperate DataAnnotations from our POCOs within a Silverlight project. One way to do this outside of SL is to use buddy classes e.g:

[MetadataTypeAttribute(typeof(MyPOCO.POCOMetaData))]
public partial class MyPOCO
 {
     internal sealed class POCOMetaData
     {
         [Required(ErrorMessage="Requires name.")]
         public string Name { get; set; }
         [Required(ErrorMessage = "Requires age.")]
         public string Age { get; set; }
     }
 } 

However as of Silverlight 4, the MetadataType attribute does not exist within System.ComponentModel.DataAnnotations namespace. Has anyone found an alternative way to seperate DataAnnotation attributes from POCOs? I am looking into this as I was planning on using T4 templates to generate our basic POCO classes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:27:30+00:00Added an answer on May 22, 2026 at 2:27 pm

    This scenario looks somehow strange, why wouldn’t you want to decorate your POCOs themselves?

    1 – If there is a matching server, consider using WCF RIA Services and declare your POCOs at the server side, the RIA engine will then generate for you all the proxies at the client side, including all its annotations, and many other goodies.
    2 – If there is no matching server and you want to manipulate the data on client side, then I would go for WPF and have a wider range of desktop development capabilities.
    3 – Unfortunately, TypeDescriptor is also not implemented in Silverlight, so you can’t even add the attributes dynamically at runtime (in case you would want go that dirty-handed).

    So I’m affraid your chances are:

    1. Attach the MD to partial classes
    2. Decorate your POCOs
    3. Use WCF-RIA and declare the POCOs at the server-side
    4. Go WPF
    5. Please take a look on PEM. the EDMX designer can be extended, maybe the class designer can be extended too (oops, unfortunately seems it isn’t).
    6. Suggest to the SL team for this feature to be implemented.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to open an preview.aspx page in a seperate window from INSIDE
I'm trying to seperate a number from a string in python. Basically I want
Trying to figure out the best way to accomplish this. I have inhereted a
I am trying to use the NDbUnit. I have created seperate XSD for each
I have a flex .swf and a seperate AIR project which I'm trying to
Hei there, right now I'm trying to connect two seperate Subapps with one view.
I'm trying to get at the best way to seperate the concerns of my
I have recreated the Predicatebuilder class in a seperate C# project and I'm trying
I am trying to delete all files on the Desktop of seperate users from
I'm trying to find the best way to uncouple messageboxes from my logic so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.