public void Get_by_id() { var db = new FakeDbConnection(); db.Query <User, Account, Role, int>(p => p.Id, (p, c) => p.Account = c, p => p.Roles, data: new { Id = 2 }, filters: new List <Filter> { new Filter { Type = FilterType.Scalar, Field = "Id", Operator = FilterOperator.Equal, Value = "@Id" } }, projections: new List <Projection> { new Projection { Type = ProjectionType.OneToOne, Field = "Account" }, new Projection { Type = ProjectionType.OneToMany, Field = "Roles" } }, orderBy: x => x.CreatedAt.Desc()); var query = db.GetLastQuery(); _console.WriteLine(query.Sql); }