Download: Epicor_10_LINQPad_Starter.linq (3.9 KB)
Intro
Have you always wanted to make use of LINQPad for BPM Prototyping, but got stuck in configuration limbo and weren’t quite sure how to reference assemblies to make use of the ErpContext? If yes, then this quick-starter guide is for you.
I am going to assume you know what LINQPad is and what benefit’s you get with the professional version and if not then visit https://www.linqpad.net/ for more information.
Screenshots
Download Starter File
Download: Epicor_10_LINQPad_Starter.linq (3.9 KB)
Credits
When Epicor 10.1.400 was released @Edge sent me his . linq files which required little to no configuration and it makes use of the web.config, reads the connection details and with it, allows you to use the ErpContext() or IceContext() - you know that fancy Db object in Method and Data Directives, yes that one. Thank’s Stephen!
Configuration
Once you download the Epicor_10_LINQPad_Starter.linq file and open it.
Press F4 it will bring up a dialog where you can point to your Server’s Assemblies. Fix the ones in RED, shown below are the typical 10.1.500.x paths for the Assembly Locations.
The Starter file includes common used Namespaces:
In the LINQPad Window point to your web.config file:
You should be all set, it was that easy. You don’t need a Connection! Remember it reads it from your web.config
Few Gotchas
- If you are having connection issue(s) make sure that your web.config file isn’t pointing to Database Server (local) which is usually seen when the SQL Database is on the same machine as the App Server, common in development environments. Make sure you change it to the actual server name instead.
-
One limitation is that you can’t use ttTables, the idea is that you use this with actual tables such as Db.Part and prototype, debug and analyze your query. Once you are confident that it’s all good to go - you make some minor tweaks and paste it into a BPM.
-
When you want to use Business Objects such as Ice.Core.Session etc, make sure you add the Assembly to your references - typically you will add BO .dll’s from your Local Epicor Client Folder
-
Can’t use LockHint, unless you probably specify an additional assembly.
-
For Epicor 10.2 make sure you enable the commented-out line EpiProviderRegistrator.Register();
Have Fun
Overall, you can use Business Object’s, Query Syntax or Method Syntax . Prototyping in LINQPad has often saved me from various headaches in the past. If you have the Paid LINQPad Version, you get to enjoy some additional IntelliSense.
Wait Theres More Reminder
If you do use the BOs make sure you Press F4 to include the Assemblies!