Skip to content

Instantly share code, notes, and snippets.

View logicbomb's full-sized avatar

Jason Turim logicbomb

  • Chevy Chase, MD
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<connectionStrings>
<add name="forum-db" connectionString="Data Source=.\SQLExpress;Initial Catalog=forum-db;Integrated Security=SSPI;Persist Security Info=False;" />
</connectionStrings>
<log4net>
<root>
@logicbomb
logicbomb / gist:1554250
Created January 3, 2012 09:28
Nancy.ModelBinding.ModuleExtensions.Bind() Issues
public class MyBinder : IModelBinder
{
public object Bind(NancyContext context, Type modelType, params string[] blackList)
{
var implementation = GetImplementationFromFormVariables(context.Request.Form);
return implementation as IMyInterface; //I don't think the cast is necessary here, but it illustrates the point
}
public bool CanBind(Type modelType)
{
@logicbomb
logicbomb / gist:1563794
Created January 5, 2012 05:03
ModelBinding failing tests
public IAmAnInterface TestBindAndCastToInterface()
{
var result = this.Bind();
return (IAmAnInterface)result;
}
public Concrete TestBindAndCastToConcrete()
{
var result = this.Bind();
return (Concrete)result;
@logicbomb
logicbomb / gist:1830880
Created February 14, 2012 22:00
topshelf service install
using System;
using System.IO;
using Lemur.Logging;
using log4net.Config;
using NConfig;
using Topshelf;
namespace Lemur.CommandHost
{
public class Program : ILoggingSource
@logicbomb
logicbomb / gist:1897607
Created February 24, 2012 04:20
MT error
Json: {
"requestId":"ac2aa039-ede3-4f29-b0ee-9fff017e5d37",
"destinationAddress":"msmq://djlancerock/my_commandhost?tx=false",
"headers":null,
"message":{
"failedMessage":
{
"issuedBy":"msmq://localhost/my_commandhost",
"implementingType":"my.Commands.DiagnosticCommand, MyCommand , Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","identifier":"00000000-0000-0000-0000-000000000000"
},
@logicbomb
logicbomb / gist:1905604
Created February 25, 2012 03:10
MassTransit Bug
public interface ICommandPublisher
{
void Publish(ICommand command);
}
public class MassTransitCommandPublisher : ICommandPublisher, ILoggingSource
{
public void Publish(ICommand command)
{
this.Debug("Publishing command {0}", command.GetType().Name);
@logicbomb
logicbomb / gist:1922025
Created February 27, 2012 06:51
CompositeMetadata
{
Name,
Description,
IsValid,
ConfigurationErrors [], //string
Agents [ ],
Commands [ ],
Queries [ ],
InputModels [ ]
}
@logicbomb
logicbomb / gist:1944331
Created February 29, 2012 21:04
Queries
[{
AgentSystemName,
PartName,
PartNamespace,
Arguments [{
Type,
Name,
Choices [] //string array,
MultiChoice,
DefaultValue
[{
Description,
DescriptiveName,
IsValid,
AgentSystemName,
Commands [ ],
Queries [ ],
ReadModels [ ]
}]
{
Description,
DescriptiveName,
IsValid,
AgentSystemName,
Commands [ ],
Queries [ ],
ReadModels [ ]
}