New Posts New Posts RSS Feed: Serialization of Custom Properties
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Serialization of Custom Properties

 Post Reply Post Reply
Author
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Topic: Serialization of Custom Properties
    Posted: 09-Jul-2010 at 6:08pm
If you have defined a custom property (one not backed by the database) on an Entity and want that property's value to be propagated between the client, server, a stream, or imported into another EntityManager, you need to make it serializable.
 
You can make a property serializable by:
  1. Mark it with the [DataMember] attribute.
  2. Make sure you it has a setter.

If you are in Silverlight, you will also need to make sure that:

  1. The getter and setter are public OR
  2. Add the [InternalsVisibleTo] attribute to the AssemblyInfo.cs of the model assembly:

[assembly: InternalsVisibleTo("System.Core, PublicKey=00240000048000009400000006020000002400005253413100040000010001008d56c76f9e8649383049f383c44be0ec204181822a6c31cf5eb7ef486944d032188ea1d3920763712ccb12d75fb77e9811149e6148e5d32fbaab37611c1878ddc19e20ef135d0cb2cff2bfec3d115810c3d9069638fe4be215dbf795861920e5ab6f7db2e2ceef136ac23d5dd2bf031700aec232f6c6b1c785b4305c123b37ab")]

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down