Skip to content

Instantly share code, notes, and snippets.

View nicknow's full-sized avatar

Nicolas Nowinski nicknow

View GitHub Profile
@nicknow
nicknow / PolymorhpicYamlConversion.cs
Created December 28, 2024 17:22
A model for doing YAML serialization/deserialization using YamlDotNet where the object graph list arrays that use an interface, i.e., List<IInterface>, that need to be converted to/from concrete classes that implement the interface.
/*
MIT License
Copyright (c) 2024 Nicolas A. Nowinski ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@nicknow
nicknow / Timing Using Action vs Direct - C#
Created July 18, 2018 18:28
Test to determine if there is a performance impact calling a method passed as an Action instead of directly. To be run in LinqPad (as a C# Program)
void Main()
{
RunDirectly();
RunIndirectly();
var sw = new Stopwatch();
sw.Start();
for (int i = 0; i < 100; i++)
{
namespace nicknow.Logging
{
static class NonSandboxedExceptionLogging
{
///From the example at http://stackoverflow.com/a/12827271/394978
/// <summary>
/// This utility method can be used for retrieving extra details from exception objects. Cannot be used in code running in the Dynamics CRM Sandbox
/// </summary>
/// <param name="e">Exception.</param>
/// <param name="indent">Optional parameter. String used for text indent.</param>
@nicknow
nicknow / CrmHelperExtensions.cs
Last active October 15, 2016 09:06
Dynamics CRM Helper Extension Methods
// See end of file for Copyright and MIT License.
using System;
using Microsoft.Xrm.Sdk;
namespace ThinkCrm.Helper
{
public static class CrmHelperExtensions
{
@nicknow
nicknow / FetchXML_Retrieve_AccessTeamMembers.xml
Created May 19, 2015 22:21
Dynamics CRM FetchXML Example To Retrieve Access Team Members
<fetch count="50" >
<entity name="opportunity" >
<attribute name="name" />
<link-entity name="principalobjectaccess" from="objectid" to="opportunityid" link-type="inner" alias="poa" >
<attribute name="objectid" alias="objectid" />
<link-entity name="team" from="teamid" to="principalid" link-type="inner" >
<link-entity name="teamtemplate" from="teamtemplateid" to="teamtemplateid" >
<attribute name="teamtemplatename" />
</link-entity>
<link-entity name="teammembership" from="teamid" to="teamid" link-type="inner" intersect="true" >