locked
GetTable does not return ID field. RRS feed

  • Question

  • Using the following class where the ID data member is the index/primary key of the record

    [DataContract]
    public class User
    {
       [DataMember(Name = "Id")]
       public int ID { get; set; }

       [DataMember(Name = "mydata")]
         public string MyData { get; set; }

       [DataMember(Name = "Longitude")]
         public float Longitude { get; set; }

       [DataMember(Name = "Latitude")]
         public float Latitude { get; set; }
    }

     I make the following call...

    List<Users> lUsers = await MobileService.GetTable<User>().Where(User => User.MyData == 1234).ToListAsync();

    The ID data member always returns as a 0.  I can't seem to find any way to get the actual id in a query however I need it to do an update.

    Any help?

    Thursday, May 23, 2013 6:26 PM

Answers

All replies