Skip to content

Instantly share code, notes, and snippets.

View stimms's full-sized avatar
💭
Talking at #MSIgniteToronto

Simon Timms stimms

💭
Talking at #MSIgniteToronto
View GitHub Profile
@stimms
stimms / .block
Last active February 6, 2022 23:30 — forked from d3noob/.block
Sample of layout for question flow
license: mit
{
"Action": "UPDATE",
"Data": {
"id": "1e607415-27c0-40e1-9427-47eda4cc138b",
"FirstName": "Bob",
"LastName": "McKenzie",
"PracticeName": "Bob's stupid law practice",
"EMailAddress": "bob@example.com",
"streetName": null,
"streetNumber": null,
// option 1 - async
async function draw() {
    var contactId = parent.Xrm.Page.data.entity.getId();
    connections = await getConnectionsByContactId(contactId);
}
async function getConnectionsByContactId(contactId) {
    const result = await Xrm.WebApi.retrieveRecord("contact", contactId,
        `?$expand=contact_connections1($select=_record2id_value,connectionid,name,record2objecttypecode,entityimage_url)
@stimms
stimms / Program.cs
Created May 26, 2018 19:28
Benchmark of list null checking
using System;
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Columns;
using BenchmarkDotNet.Attributes.Exporters;
using BenchmarkDotNet.Attributes.Jobs;
using BenchmarkDotNet.Running;
namespace benchmark
{
@stimms
stimms / logs.txt
Created December 20, 2017 20:42
log chunk showing error
{
"Environment": "Prod",
"Region": "East US",
"time": "2017-12-20T19:09:01.3134767Z",
"resourceId": "/SUBSCRIPTIONS/8C449441-BBF5-40EE-BFAD-62B06ADC8EC5/RESOURCEGROUPS/AFFINITI/PROVIDERS/MICROSOFT.STREAMANALYTICS/STREAMINGJOBS/TESTINGEST",
"operationName": "Send Events: CosmosDB Output Prepare Data failure",
"category": "Execution",
"status": "Failed",
"level": "Error",
"properties": "{\"Error\":null,\"Message\":\"An error occurred while preparing data for CosmosDB. The output record does not contain the column '$pk' to use as the partition key property.\",\"Type\":\"DocumentDbOutputAdapterPrepareDataError\",\"Correlation ID\":\"77019b03-3468-4cf6-a8f7-c05125c4b3b0\"}"
@stimms
stimms / output.json
Created December 20, 2017 20:30
output in blob storage
{"$pk":"10.1.2.252","id":"DNS:2017-12-20T19:59:45.0000000Z","outputtime":"2017-12-20T19:59:45.0000000Z","nprobe_ipv4_address":"10.1.2.252","l7_proto_name":"DNS","total_bytes":848.0}
{"$pk":"10.1.2.252","id":"DNS:2017-12-20T20:05:45.0000000Z","outputtime":"2017-12-20T20:05:45.0000000Z","nprobe_ipv4_address":"10.1.2.252","l7_proto_name":"DNS","total_bytes":1272.0}
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<?xml version="1.0" encoding="utf-8"?>
<extension xmlns="urn:newrelic-extension">
<instrumentation>
<tracerFactory>
<match assemblyName="NServiceBus.Core" className="NServiceBus.Pipeline.MessageHandler">
<exactMethodMatcher methodName="Invoke" parameters="object,System.Action,NServiceBus.IMessageHandlerContext" />
</match>
</tracerFactory>
<tracerFactory>
<match assemblyName="NServiceBus.Core" className="NServiceBus.OutgoingContext">
//what is generated
ILog log;
IAttributeCodeInfoProvider attributeCodeInfoProvider;
public Handler(IAttributeCodeInfoProvider attributeCodeInfoProvider, ILog log)
{
this.attributeCodeInfoProvider = attributeCodeInfoProvider;
this.log = log;
}
//what I'd like
@stimms
stimms / agenda.markdown
Last active October 28, 2016 12:39
Possible agenda for .NET Core training

#Day 1 topic: Foundations

Time Topic Details
9:00-10:30 Level set and introduction to ASP.NET Core What is everybody's background? Helps us push parts of the course in the right direction. We should probably get people to fill out a survey on regisration too. Why did they rewrite .NET Core? Is it really that different from MVC 4/5? Introduce dependen injection
10:30-10:45 Break
10:45-12:15 Creating a new project Get people started with Visual Studio. Perhaps introduce VS Code. Create a new controller, create views, create a model. Discuss what sorts of data go into view models and what we should inject. Talk a bit about conventions for naming views and routes. I don't like special routes but some people do because they can't leave well enough alone
12:15-1:00 Lunch
1:00-2:30 Entity Framework How do I get data? Migrations. Setting up multiple bounded contexts. How to check if the queries are good/performant? How to break out of EF and run raw queries for places where you ne