-
Notifications
You must be signed in to change notification settings - Fork 5
LINQPadCustomVisualizer
I have created two packages of LINQPad Custom Visualizers, the first, AW.LinqPadCustomVisualizers.V2.0.zip , is non-LLBLGen Pro specific and exposes these 3Controls to LINQPad to be displayed in the output panel: the GridDataEditor, HierarchyEditor and Object Inspector. The second package is my LLBLGen Pro Data Driver which contains the first package with additional LLBLGen Pro specific calls to those visualizers, plus an additional control: theEntity Explorer.
This displays the results of a LINQPad query in the GridDataEditor in the output panel to enable filtering of the data via the UI and editing ofLLBLGen Pro entities, as theLINQPad grid can only edit LINQToSQL entities. DisplayInGrid shows the normal properties that a datagridview would show plus public fields - this has been done as it seems the automatic LINQToSQL datacontext uses fields rather than properties. DisplayInGrid returns an empty enumeration rather than void simply so it can be used with theLINQPad expression language where the output gets piped to the dump command which throws and error if it returns void.
To save the changes to the DB a DataEditorPersister must be supplied, except for LINQToSQL and LLBL queries, where there are extension methods which use built-in LINQToSQL and LLBL DataEditorPersisters. If no DataEditorPersister is provided then the GridDataEditor will be in a readonly mode.
NutShell DB (included with LINQPad samples)
Customers.DisplayInGrid()
Call one of the overloads and variations of the DisplayInGrid extension method listed here:LLBL, Other
This displays the results of a LINQPad query in the HierarchyEditor in the output panel for displaying and editing Adjacency List (self referencing) data in a tree.
An example of this data is the HumanResources.Employee table in the adventureworks DB.
Employee.ToEntityCollection().DisplaySelfServicingHierarchyInTree("EmployeeID", "ManagerID", "EmployeeDisplayName")
Which display in the LINQPad output panel like so:
As well as the treeview there is a propertygrid showing the currently selected node and a grid showing all the children of that node.
Call one of the overloads and variations of the DisplayHierarchyInTree extension method listed here:LLBL, Other You need to supply the name of the identity property, the parent property name and the name of the property to be displayed in the tree. You can optionally supply anDataEditorPersister to persist any changes you make.
This displays an Object Inspector for browsing the properties of an object and any objects it references in the output panel.
NutShell DB (included with LINQPad samples)
Customers.First().Inspect()
This displays an Entity Explorer to browse and edit LLBLGen Pro entities from a database in the output panel.
this.Explore()
Call the Explore extension method listed here: LLBL
If you are using the LLBLGen Pro Data Context Driver this is included and should be available for queries using this driver. If not, download AW.LinqPadCustomVisualizers.V2.0.zip and then unzip to the LINQPad plugins folder (usually %USERPROFILE%\Documents\LINQPad Plugins).
For version history see release notes in download pages: Version 2.0, Version 1.0
Other LINQPad Custom Visualizers
- LINQPadSpy - shows decompiled sources from queries which have been compiled by LINQPad allowing one to see any additional compiler generated code
- Histograms and LinqPad
- LINQPad.QueryPlanVisualizer - view query execution plan and missing indexes