This file contains hidden or 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
using System; | |
using System.Net; | |
using Subroute.Common; | |
using System.Configuration; | |
using System.Linq; | |
using System.Collections.Generic; | |
using Newtonsoft.Json; | |
// Slack webhook example | |
namespace Subroute.Container | |
{ |
This file contains hidden or 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
This is an example how to perform multi-select faceting in ElasticSearch. | |
Selecting multiple values from the same facet will result in an OR filter between each of the values: | |
(facet1.value1 OR facet1.value2) | |
Faceting on more than one facet will result in an AND filter between each facet: | |
(facet1.value1 OR facet1.value2) AND (facet2.value1) | |
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh). |
This file contains hidden or 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
function global:Disable-NServiceBusSetupCheck() | |
{ | |
#default to current dir when debugging | |
if(!$solutionScriptsContainer){ | |
$solutionScriptsContainer = "./" | |
} | |
$packagesFolder = Join-Path $solutionScriptsContainer "..\packages" -Resolve | |
Push-Location $packagesFolder |
This file contains hidden or 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
using System; | |
using NUnit.Framework; | |
using Search.QueryUnderstanding.Api.Application; | |
[SetUpFixture] | |
public class ElasticSearchIntegrationTestSetupFixture | |
{ | |
private readonly ElasticSearchTestClient client = new ElasticSearchTestClient(new ElasticSearchConfiguration()); | |
private readonly ElasticSearchTestContext context = new ElasticSearchTestContext(); |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Data.Entity; | |
using System.Linq; | |
public class DatabaseDeleter | |
{ | |
static readonly string[] _ignoredTables = | |
{ | |
"sysdiagrams", |
This file contains hidden or 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
using System; | |
using System.Data.Entity; | |
public static class EntityFrameworkExtensions | |
{ | |
/// <summary> | |
/// Given an id, creates a reference to an existing (persisted) *unchanged* entity | |
/// </summary> | |
/// <typeparam name="TEntity">Entity CLR type</typeparam> | |
/// <param name="db">DbContext</param> |
This file contains hidden or 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
using System.Threading.Tasks; | |
using System.Web.Mvc; | |
using JetBrains.Annotations; | |
using ShortBus; | |
public abstract class BaseController : Controller | |
{ | |
public IMediator Mediator { get; set; } | |
protected Response<TResult> Query<TResult>(IQuery<TResult> query) |
This file contains hidden or 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
using System.Web.Mvc; | |
using JetBrains.Annotations; | |
using ShortBus; | |
public abstract class BaseController : Controller | |
{ | |
public IMediator Mediator { get; set; } | |
protected Response<TResult> Query<TResult>(IQuery<TResult> query) | |
{ |
This file contains hidden or 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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Text; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
public static class ShouldExtensions | |
{ | |
/// <summary> |
This file contains hidden or 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
function global:Delete-BinObj() | |
{ | |
$path = join-path $solutionScriptsContainer '..' -resolve | |
Get-ChildItem $path -include bin,obj -recurse -Force | remove-item -force -recurse | |
} |
NewerOlder