locked
Modified T4 to create derived property but data doesn't transfer. RRS feed

  • Question

  • I added the ADO.Net EntityObject Generator and modified the tt file to add an additional property to one of my entities.  I'm using WCF Data Services where I've defined a WebGet decorated method that retrieves a collection of the entity that I added the property to.  I then populate this property with data but, unfortunately, the data doesn't transfer to the client.  If I decorate this derived property with EdmScalarPropertyAttribute I get an error:

    'The number of members in the conceptual type does not match with the number of members on the object side type. Make sure the number of members are the same.'

    Any ideas on how I can add this derived property so that I can populate it on the server side and have the data transfer to the client side? 

    Paul Lethers

    Sunday, July 17, 2011 4:54 PM

Answers

  • I abandoned the idea to modify classes that are generated and, instead, I set up another WCF service with my own set of poco classes....works great!
    • Marked as answer by Paul Lethers Friday, July 22, 2011 5:56 PM
    Friday, July 22, 2011 5:55 PM

All replies

  • Hi,

    Have you added the [DataMemberAttribute()] to your property? You need to add DataMember since the class are marked with the DataContractAttribute.

    Hope this helps!


    --Rune
    Monday, July 18, 2011 8:21 AM
  • Hi Paul,

    I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know. I will be more than happy to be of assistance.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 22, 2011 6:43 AM
  • I abandoned the idea to modify classes that are generated and, instead, I set up another WCF service with my own set of poco classes....works great!
    • Marked as answer by Paul Lethers Friday, July 22, 2011 5:56 PM
    Friday, July 22, 2011 5:55 PM