This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class D365FoProxy | |
{ | |
private readonly string _token; | |
private readonly string _url; | |
public Resources Context { get; private set; } | |
public D365FoProxy(string token, string url = "https://XXXXXX.sandbox.operations.dynamics.com/data") | |
{ | |
_token = token; | |
_url = url; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.6.0")] | |
private static global::System.Xml.XmlReader CreateXmlReader(string edmxToParse) | |
{ | |
string edmxContent = ""; | |
string resourceName = ""; | |
var assembly = System.Reflection.Assembly.GetExecutingAssembly(); | |
var names = assembly.GetManifestResourceNames(); | |
foreach(var name in names){ | |
if (name.Contains("edmx.xml")){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
sanitise database | |
remove any production data or permissions | |
#> | |
[CmdletBinding()] | |
param ( | |
[string] $environment, | |
[string] $tenantid, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
import a database from a blob container in another subsciption | |
#> | |
[CmdletBinding()] | |
param ( | |
[string] $environment, # to environment | |
[string] $tenantid, | |
[string] $production_subscriptionid, | |
[string] $production_spn_clientid, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Export the production database to blog container | |
#> | |
[CmdletBinding()] | |
param ( | |
[string] $tenantid, | |
[string] $subscriptionid, | |
[string] $spn_clientid, | |
[string] $spn_secret | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { }, | |
"variables": { }, | |
"resources": [ ], | |
"outputs": { } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop table #dbcc_events_from_trace | |
declare @Help TINYINT = 0 | |
declare @CheckUserDatabaseObjects TINYINT = 1 | |
declare @CheckProcedureCache TINYINT = 0 | |
declare @OutputType VARCHAR(20) = 'TABLE' | |
declare @OutputProcedureCache TINYINT = 0 | |
declare @CheckProcedureCacheFilter VARCHAR(10) = NULL | |
declare @CheckServerInfo TINYINT = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Parse logic app json and reorder logically | |
*/ | |
string Json = string.Empty; | |
IList<string> Paths = new List<string>(); | |
IDictionary<string, string> RunAfter = new Dictionary<string, string>(); | |
void Main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Profile results returned from a stored procedure using https://miniprofiler.com | |
https://github.com/MiniProfiler/dotnet/blob/master/samples/Samples.Console/Program.cs | |
*/ | |
static string sproc = "ProjectTracking_GetForReport"; | |
static volatile int count = 0; | |
static MiniProfiler mp; | |
public async System.Threading.Tasks.Task Main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
// 0,1,1,2,3,5 | |
Fib(10).Dump(); | |
Fib2(10).Dump(); | |
Fib3(10).Dump(); | |
} | |
// mutate in loop | |
int Fib(int x) |