Skip to content

Instantly share code, notes, and snippets.

public virtual NodeReference<TNode> Create<TNode>(
TNode node,
IEnumerable<IRelationshipAllowingParticipantNode<TNode>> relationships,
IEnumerable<IndexEntry> indexEntries)
where TNode : class
{
if (node == null)
throw new ArgumentNullException("node");
relationships = relationships ?? Enumerable.Empty<IRelationshipAllowingParticipantNode<TNode>>();
void CreateClients(MigrationMessage migrationMessage)
{
var agencyUniqueId = migrationMessage.AgencyUniqueId;
var agency = agencyService.GetAgencyByUniqueId(agencyUniqueId);
if (agency == null)
throw new ApplicationException("Agency unique id provided for the import process does not match any existing agencies.");
using (var connection = new SqlCeConnection(connectionString))
using (var canonicalDb = new ImportDbContext(connection))
NodeReference<Client> TryImportClient(Node<Agency> agency, Clients client, DateTimeOffset timeFirstAttempted)
{
NodeReference<Client> reference;
var callStarted = DateTimeOffset.UtcNow;
try
{
reference = importClientService.ImportClient(client, agency);
}
catch (Exception ex)
using System;
using MyStory.Logic.Models;
using MyStory.Logic.Models.ImportSchema;
using Neo4jClient;
using Omu.ValueInjecter;
namespace MyStory.Logic.Services.Import
{
public class ImportClientService : IImportClientService
{
@Romiko
Romiko / Windows Azure Deployment Script - UAT.ps1
Created November 1, 2011 05:11
Windows Azure Deployment Script - UAT
#requires -version 2.0
param (
[parameter(Mandatory=$true)] [string]$AzureAccountName,
[parameter(Mandatory=$true)] [string]$AzureServiceName,
[parameter(Mandatory=$true)] [string]$AzureDeploymentSlot,
[parameter(Mandatory=$true)] [string]$AzureAccountKey,
[parameter(Mandatory=$true)] [string]$AzureSubscriptionId,
[parameter(Mandatory=$true)] [string]$AzureCertificateThumbprint,
[parameter(Mandatory=$true)] [string]$PackageSource,
[parameter(Mandatory=$true)] [string]$ConfigSource,
@Romiko
Romiko / Proxy.cmd
Created November 1, 2011 05:18
Powershell Proxy Script - Written by Jason Stangroome
@echo off
setlocal
set tempscript=%temp%\%~n0.%random%.ps1
echo $ErrorActionPreference="Stop" >"%tempscript%"
echo ^& "%~dpn0.ps1" %* >>"%tempscript%"
powershell.exe -command "& \"%tempscript%\""
set errlvl=%ERRORLEVEL%
del "%tempscript%"
exit /b %errlvl%
@Romiko
Romiko / DeployAzureCSXToLocalDevFabric.ps1
Created November 1, 2011 05:33
Deploy CSX Package to Local Development Fabric
#requires -version 2.0
param (
[parameter(Mandatory=$true)] [string]$AzurePackagePath,
[parameter(Mandatory=$true)] [string]$AzureSdkRootPath,
[parameter(Mandatory=$true)] [int]$RetryCountForPolling
)
$ErrorActionPreference = "Stop"
$csrun="$AzureSdkRootPath\bin\csrun.exe"
@Romiko
Romiko / Sample SQLCE Build Targets.csproj
Created November 1, 2011 23:31
Sql CE in the cloud. Need to ensure correct structure within the bin folder
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
....all sorts of config stuff
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\SqlServerCompact.4.0.8482.1\lib\System.Data.SqlServerCe.dll</HintPath>
</Reference>
@Romiko
Romiko / migration.sql
Created November 1, 2011 23:45
Sample SQLCE Script
;--EndBatch
;--EndBatch
CREATE TABLE [Clients](
[ExternalSystemName] [nvarchar](50) NOT NULL,
[ExternalSystemId] [nvarchar](50) NOT NULL,
[GivenName] [nvarchar](100) NOT NULL,
[MiddleNames] [nvarchar](200) NULL,
[FamilyName] [nvarchar](100) NOT NULL,
[PreferredName] [nvarchar](100) NULL,
[Gender] [nvarchar](10) NULL,
@Romiko
Romiko / CircuitBreaker_ThreadOptmization
Created November 1, 2011 23:59
Sample Circuit breaker usage with Neo4j and thread optimization
void CreateClients(MigrationMessage migrationMessage)
{
var agencyUniqueId = migrationMessage.AgencyUniqueId;
var agency = agencyService.GetAgencyByUniqueId(agencyUniqueId);
if (agency == null)
throw new ApplicationException("Agency unique id provided for the import process does not match any existing agencies.");
using (var connection = new SqlCeConnection(connectionString))
using (var canonicalDb = new ImportDbContext(connection))