Configuring LINQPad for NCache
NCache offers seamless integration with LINQPad, a .NET utility often used to interactively query SQL databases using LINQ and Lambda expressions as well as to interactively write C# without the need for an IDE. NCache provides its own provider to support LINQ queries in LINQPad for better data analysis and ease of use.
NCache integration with LINQPad is quite simple as it requires just adding a reference to the NCache LINQPad provider and the custom objects that you have stored in NCache. The objects being queried must be indexed in NCache.
The following section has been implemented using LINQPad 5.
To configure LINQPad for NCache querying, follow these steps:
Open up LINQPad and go to File -> New Query or Press Ctrl + N.
On Query menu, click Reference and Properties or press F4 to add reference. Query Properties wizard pops up.
In Additional References tab, click Browse. An Open dialog will appear.
Browse to %NCHOME%\integrations\LinqPad and select Alachisoft.NCache.LinqPadIntegration.dll. Click Open.
Browse to %NCHOME%\integrations\LINQToNCache and select Alachisoft.NCache.Linq.dll. Click Open.
Similarly, add the assemblies for your custom objects.
Select Additional Namespace Imports tab from Query Properties page.
Click Pick from Assemblies **link and choose
Alachisoft.NCache.LinqPadIntegration.dllfrom **Assemblies section. This would populate the Namespaces section on current tab.
Alachisoft.LinqPadIntegrationand click < Add Selected Namespaces.
Perform the same steps for Alachisoft.NCache.Linq.dll and the custom classes added.
It is suggested to click Set as default for new queries button to persist references for all new queries.