[CLOSED] DirectMethod deserializing readonly property

  1. #1

    [CLOSED] DirectMethod deserializing readonly property

    I have a grid that binds to a collection of Person object. Person has a readonly PersonId that I use to uniquely identify a person. In a directmethod, I pass back the grid's store's records. The directmethod has an argument of type List<Person>. Since PersonId is readonly, it is not being set when deserializing from client JSON data. Therefore, I lost ability to know which person each record is. Is there a workaround? I can not modify the Person object. The property is readonly because it comes from the database as an identity column.
    Last edited by Baidaly; Jul 17, 2013 at 11:50 PM. Reason: [CLOSED]
  2. #2
    I guess that no workaround because we cannot change property value
    What about to create a new class with same set of properties (just empty auto properties with get;set;) and deserialize to that class or deserialize to Dictionary?
  3. #3
    Quote Originally Posted by Vladimir View Post
    I guess that no workaround because we cannot change property value
    What about to create a new class with same set of properties (just empty auto properties with get;set;) and deserialize to that class or deserialize to Dictionary?
    We been doing Wrapper classes but that gets cumbersome after awhile. I guess we will keep doing that for now.

Similar Threads

  1. ReadOnly Property
    By YusufHotelwala in forum 1.x Help
    Replies: 4
    Last Post: Sep 25, 2011, 8:14 PM
  2. Readonly Property
    By vivekrane1986 in forum 1.x Help
    Replies: 2
    Last Post: Sep 14, 2010, 6:08 AM
  3. readonly property
    By maxdiable in forum 1.x Help
    Replies: 0
    Last Post: Jan 21, 2010, 11:51 AM
  4. Readonly property
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 01, 2008, 5:25 PM
  5. Replies: 1
    Last Post: Nov 21, 2008, 7:10 AM

Posting Permissions