28
Using LINQPad with Dynamics Presented by: Ben Walker, University of Oxford

Using LINQPad with Dynamics - D365UG

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using LINQPad with Dynamics - D365UG

Using LINQPad with Dynamics

Presented by: Ben Walker, University of Oxford

Page 2: Using LINQPad with Dynamics - D365UG

About Me•Technical Team Lead

•20 years in IT, working with CRM since 2011

•Lead a small team developing applications for the University.

[email protected]

• @bwmodular

• Blog: http://blogs.it.ox.ac.uk/benwalker/

Page 3: Using LINQPad with Dynamics - D365UG

Agenda• What is LINQPad?

• Connecting to CRM with LINQPad

• Using LINQPad for:

• Prototyping

• Learning

• Debugging

• Testing

• Support

• Raffle

Page 4: Using LINQPad with Dynamics - D365UG

What is LINQPad

LINQPad is a ‘scratchpad’ for .Net Developers.

It’s a lightweight editor which allows you to write, execute and

debug ‘fragments’ of code, from individual expressions to

complete programs.

Because sometimes all you need is a script, not a whole Visual

Studio project…!

Let’s see it in action!

https://www.linqpad.net/

Page 5: Using LINQPad with Dynamics - D365UG

Demo

Page 6: Using LINQPad with Dynamics - D365UG

LINQPad as a learning tool

• Developed by Joseph Albahari www.albahari.com

Page 7: Using LINQPad with Dynamics - D365UG

LINQPad as a learning tool

• Look through the Sample Libraries

• Great for Exploring Unfamiliar API’s

• Create a common code library to share with colleagues

• Ctrl + Shift + F to search all samples and scripts

Page 8: Using LINQPad with Dynamics - D365UG

NUGET integration

• Full Nuget integration (with Developer and Premium editions)

• Nuget libraries are cached – only need to get them once- then they are available to all other scripts

Page 9: Using LINQPad with Dynamics - D365UG

LINQPad Drivers

• Many drivers exist for different datasources.

• We’ll see CRM in a minute, but here are some others:http://www.linqpad.net/richclient/datacontextdrivers.aspx

Page 10: Using LINQPad with Dynamics - D365UG

Connecting LINQPad to CRM

• 2 Options• CRM LINQPad Driver

• Manual Connection

• Manual connections can use password manager

CRM Connections – quick switch between orgs

• http://blogs.it.ox.ac.uk/benwalker

• http://blogs.it.ox.ac.uk/benwalker/2017/04/20/connecting-linqpad-to-dynamics-crm-using-the-dynamics-crm-linqpad-driver/

• http://blogs.it.ox.ac.uk/benwalker/2017/04/20/connecting-linqpad-to-dynamics-crm-using-a-manually-created-connection/

Page 11: Using LINQPad with Dynamics - D365UG

Connecting LINQPad to CRMConnect using Driver Connect Manually

Quick switch between

environments

Can connect to more than one organisation

simultaneously – compare data in different

organisations

Persistent connection Impersonation of other users

Early-bound coding OOB Workaround for duplicate early-bound class name

issue *

Explore CRM Entities Driver may not work with Dynamics 2016+ **

Easy querying using LINQ

Even Less Code!

Mark Connections as Production

• * https://github.com/kenakamu/CRMLinqPadDriverWebAPI/issues/1

• ** https://crmlinqpadwebapi.codeplex.com/

Page 12: Using LINQPad with Dynamics - D365UG

How easy is….?

Creating Records

Querying Data

Executing any API call

Debugging

Page 13: Using LINQPad with Dynamics - D365UG

Impersonation

Execute code as another user

Great for support

Great for testing security roles and sharing

http://blogs.it.ox.ac.uk/benwalker/2017/04/24/using-impersonation-in-dynamics-crm/

Page 14: Using LINQPad with Dynamics - D365UG

Snippets

All Visual Studio snippets available…

…but you can also create your own

Common CRM Tasks available with a couple ofkeystrokes

http://blogs.it.ox.ac.uk/benwalker/2017/04/21/creating-snippets-for-use-with-linqpad/

Page 15: Using LINQPad with Dynamics - D365UG

Extensions

• Objects and Methods common to all queries

• Another way to share common code and reduce ‘clutter’ in scripts

Page 16: Using LINQPad with Dynamics - D365UG

Testing

Creating Test Data

Testing Plugins

Testing Security – test security roles and sharing implementations – you cannot do this with Unit Tests!

Page 17: Using LINQPad with Dynamics - D365UG

SupportScripting simple tasks

Removing Message Processing Steps – 1 script, vs 19 mouse clicks

Querying data (especially N:N)

Comparing data across environments

Creating users from spreadsheets

Synching data across environments

Metadata updates – example of accommodation attributes for ADSS

Etc…….

Page 18: Using LINQPad with Dynamics - D365UG

File-sharing and source control

No native integration with Source Control, but….

…you can easily integrate with Source Control

Change the folder locations

Page 19: Using LINQPad with Dynamics - D365UG

File-sharing and source control

Page 20: Using LINQPad with Dynamics - D365UG

File-sharing and source control

See my blog for an example of integration with VSTS:

http://blogs.it.ox.ac.uk/benwalker/2017/04/21/integrating-linqpad-scripts-into-source-control/

LINQPad also features ‘instant share’ – gives you a URL to share any script

Page 21: Using LINQPad with Dynamics - D365UG

LPRun & LinqPadless

• LPRun

Installed with LINQPad – run any .LINQ script from command line

• LinqPadless

• https://github.com/linqpadless/LinqPadless

Turn any LINQPad script into an exe (or csx)

Page 22: Using LINQPad with Dynamics - D365UG

Licencing

Four editions:

• Free

• Pro

• Developer

• Premium

Page 23: Using LINQPad with Dynamics - D365UG

Licencing

Page 24: Using LINQPad with Dynamics - D365UG

Licencing

Page 25: Using LINQPad with Dynamics - D365UG

Useful ResourcesLINQPad forums http://forum.linqpad.net/

@linqpad

My Blog: http://blogs.it.ox.ac.uk/benwalker/category/linqpad/

https://www.danclarke.com/linqpad-tips-and-tricks see Utilmethods

http://www.devcurry.com/2011/08/50-linq-examples-now-in-linqpad.html

Page 26: Using LINQPad with Dynamics - D365UG

Conclusion

• Amazing Productivity Enhancer

• Incredible Timesaver

• Great for Prototyping

• Great for CRM developers, but not just for CRM

• Perfectly hits the sweet spot in terms of features vs ease and speed of use

• I could not do without it!

Page 27: Using LINQPad with Dynamics - D365UG

Questions?

Page 28: Using LINQPad with Dynamics - D365UG

RAFFLEPrize kindly donated by Joseph Albahari