Using the following code on Mono 2.10.8 I get an “Invalid Operation Exception” when the table is empty. When there’s data I get Result!: 2.
What am I missing?
namespace ConsoleLINQ; interface uses System.Data.Linq, Mono.Data.Sqlite, DbLinq.Data.Linq, DbLinq.Sqlite, System.Linq; type ConsoleApp = class public class method Main(args: array of String); end; [System.Data.Linq.Mapping.TableAttribute] MyTable = public class public [System.Data.Linq.Mapping.Column()] property MyInteger: Integer; end; implementation class method ConsoleApp.Main(args: array of String); begin var conn := new SqliteConnection('DbLinqProvider=Sqlite;' + 'Data Source=db.sqlite'); var db := new DataContext(conn); var res := from n in db.GetTable() where n.MyInteger > 0 select n; Console.WriteLine('Result!: ' + res.First().MyInteger.ToString()) end; end.