Sqlite.net query access nested property with LinQ RRS feed

  • Question

  • User202091 posted

    Hi !

    I use sqlite.net and sqlite.net extensions

    I want to find objects by using linq expression in a sqlite.net query. Here is an example to help you picture my problem:

    class Dog { string name; Person owner; }

    class Person { string name; Dog dog; }

    My problem is I cant fetch persons by dog name:

    var person = _connection.Table<Person>().Where(pers => pers.dog.Name.StartWith("toto")).ToList();

    It throws me null object reference on Dog. I can't believe that Xamarin does not have a proper way to do that... You have any solution on how to acheive this?

    Tuesday, May 17, 2016 3:35 PM

All replies

  • User394575 posted

    I also stuck on same kind of problem. Do you find any solution to this??

    Wednesday, May 13, 2020 5:01 AM