public Locations GetLocationName(string uuid, int major, int minor) { var results = conn.Table <MMLocation>().Where(x => x.UUID == uuid && x.Major == major && x.Minor == minor); MMLocation resultMMLocation = results.FirstOrDefault(); int locationId = (resultMMLocation != null ? resultMMLocation.Id : 1); TableQuery <Locations> locationNameResult = conn.Table <Locations>().Where(x => x.Id == locationId); return(locationNameResult.FirstOrDefault()); }
public void PopulateData() { var s = new MMLocation { Id = 1, Major = 1854, Minor = 36039, LocationId = 1 }; conn.Insert(s); s = new MMLocation { Id = 2, Major = 43942, Minor = 1810, LocationId = 2 }; conn.Insert(s); s = new MMLocation { Id = 3, Major = 62614, Minor = 62288, LocationId = 3 }; conn.Insert(s); var l = new Locations { Id = 1, Name = "Bedroom" }; conn.Insert(l); l = new Locations { Id = 2, Name = "Couch" }; conn.Insert(l); l = new Locations { Id = 3, Name = "Table" }; conn.Insert(l); }