views:

38

answers:

1

Hi,

The application I am working uses a Silverlight on the client side and gets data from a database using the LINQ to SQL object explosed through a contract as in WCF.

I am trying to add a property to the object of a LINQ query result as follows:

public partial class Linq_data_class
{
    public String NewProperty { get; set; }
}

This property is not present in the database I am accessing.

I tried accessing the property in the Page.xaml.cs, but am not able to. What am I doing wrong?

Thanks...

+1  A: 

Add the [DataMember] attribute to the property. In WCF, being part of the data contract is 'opt in' -- you need to explicitly specify that a property or field is part of the contract.

itowlson
I added the DataMember attribute to the Property. I tried refreshing the Service Reference but still cannot find the NewProperty listed there. Am I missing something?
Manoj
It worked. I had to rebuild the project after the modification. Thanks!
Manoj