c# - How do I perform a LINQ query to a database? -


through method onnavigatedto () page int , make linq query list, taking items database in localstorage.

    protected override async void onnavigatedto(navigationeventargs e)     {         sqliteasyncconnection mussall = new sqliteasyncconnection("databasemusei.db");         var queryall = await mussall.table<musei>().tolistasync();         list<musei> museiall = new list<musei>();         foreach(musei mus in queryall)            {              museiall.add(mus);            }         idmusei = (int)e.parameter;         musei muss;         muss = museiall.where(x => x.id == idmusei).firstordefault();   //my code     } 

but start reading read properties in created object, exception:

message = "object reference not set instance of object." 

if on page directly object museums , do: mus = (museei) e.parameters; program works. problem?


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -