Skip to content

Instantly share code, notes, and snippets.

View MatthewDavidCampbell's full-sized avatar

Matthew Campbell MatthewDavidCampbell

  • Swedish Connection
  • Sweden
View GitHub Profile
@MatthewDavidCampbell
MatthewDavidCampbell / Batch Azure Search copy documents
Created March 6, 2023 09:33
Copying Search document with array fields
{
"name": "Batch",
"properties": {
"activities": [
{
"name": "Find",
"type": "Until",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
@MatthewDavidCampbell
MatthewDavidCampbell / dataset.json
Last active February 23, 2023 07:40
ADF Copy activity preserve metadata
{
"name": "AzureBlobStorage",
"properties": {
"linkedServiceName": {
"referenceName": "AzureBlobStorage",
"type": "LinkedServiceReference",
"parameters": {
"StorageAccountKey": {
"value": "@dataset().StorageAccountKey",
"type": "Expression"
@MatthewDavidCampbell
MatthewDavidCampbell / 1. Linked Service
Last active January 24, 2023 13:12
Azure Data Factory Copy Activity
{
"name": "AzureSearch",
"properties": {
"parameters": {
"SearchUrl": {
"type": "string"
}
},
"annotations": [],
"type": "RestService",
@MatthewDavidCampbell
MatthewDavidCampbell / AzureHttpClientRequestMessage.cs
Last active August 8, 2022 13:00
Hook when creating request
using Microsoft.OData.Client;
using System;
using System.Collections.Specialized;
using System.Web;
namespace Biometria.Discovery.OData
{
public static class Extensions
{
public static NameValueCollection UseNameValue(this NameValueCollection things, string name, string value)
@MatthewDavidCampbell
MatthewDavidCampbell / AzureSearchContextTests.cs
Last active August 8, 2022 13:54
How a query is executed and headers + request uri are adjusted
using Microsoft.OData.Client;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace Biometria.Discovery.OData.Test
{
public static class Extensions
{
private const int DeltaMilliseconds = 100;
@MatthewDavidCampbell
MatthewDavidCampbell / AzureSearchContext.cs
Last active August 8, 2022 13:03
Extends OData client context (DataServiceContext)
using Microsoft.OData.Client;
using Microsoft.OData.Edm;
using System;
namespace Biometria.Discovery.OData
{
public class AzureSearchContext : DataServiceContext
{
public AzureSearchContext(string url) : base(new Uri(url))
{
using Microsoft.OData.Client;
namespace Biometria.Discovery.OData
{
[Key(nameof(Identitet))]
// TODO: Set another name of Actor for example aktors/docs
public class Actor
{
public string Identitet { get; }
}
@MatthewDavidCampbell
MatthewDavidCampbell / LocalKestrelCommunicationListener.cs
Created April 17, 2020 06:33
Kestrel 3.1 Service Fabric Https certificate
using System;
using System.Fabric;
using System.Fabric.Description;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.ServiceFabric.Services.Communication.Runtime;
@MatthewDavidCampbell
MatthewDavidCampbell / Test case
Last active October 10, 2019 08:36
Provoking non-encoding av NameValueKey pairs in HttpClient with diagnostics
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Diagnostics;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
@MatthewDavidCampbell
MatthewDavidCampbell / SJ Konversation
Last active June 17, 2019 16:02
SJ Interrail konversation om platsreservation för ett barn (7 år)
Din chattkonversation med SJ
Hej! Tack för att du kontaktade oss. Här kommer chattkonversationen du efterfrågade. Ha en bra dag!
Med vänliga hälsningar
SJ Kundservice
SJ Kundservice
Välkommen till vår kundservice!