Print Page | Close Window

Custom Entity Properties

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2778
Printed Date: 12-Apr-2026 at 7:47pm


Topic: Custom Entity Properties
Posted By: gregweb
Subject: Custom Entity Properties
Date Posted: 17-Jun-2011 at 6:24pm
I have an Entity called EmailFolder.  In code, I add an int property called NewEmailCount.  I then link it to the SL project so it is accessible on both the client and server.  I then pass an instance of the entity from SL up to the Server via an  InvokeServerMethod, do some stuff, set the property and pass it back to the client.
 
The issue is that the NewEmailCount is always zero when it gets back to the client.  Is this correct?  It seems to me that it would be serialized and sent back over the wire to the client with the value intact.  But perhaps unless it part of the actual entity, it is just discarded and resets to the default value once it gets back to the client.
 
The reason the property is not back by a database element is that I don't really need to save the property.



Replies:
Posted By: DenisK
Date Posted: 22-Jun-2011 at 12:35pm
Hi gregweb;

Have you marked the NewEmailCount property with the [DataMember] attribute? I've tested this and the custom property value is retained if you have marked it as it needs to be serialized over the wire.


Posted By: gregweb
Date Posted: 22-Jun-2011 at 3:03pm
Great, thanks.  I had forgotten about that property!
 
Greg



Print Page | Close Window