Skip to content

Instantly share code, notes, and snippets.

Avatar

Rob "Hurricane" Ashton robashton

View GitHub Profile
@robashton
robashton / Projections with RavenDB
Created Nov 4, 2010
Demoing the expected? behaviour with projections + select many
View Projections with RavenDB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Raven.Database;
using Raven.Database.Indexing;
using Raven.Client.Indexes;
using Newtonsoft.Json.Linq;
using Raven.Client.Client;
@robashton
robashton / Projections with RavenDB.cs
Created Nov 4, 2010
Demonstrating expected? behaviour with projections/ravendb/selectmany
View Projections with RavenDB.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Raven.Database;
using Raven.Database.Indexing;
using Raven.Client.Indexes;
using Newtonsoft.Json.Linq;
using Raven.Client.Client;
@robashton
robashton / test.cs
Created Dec 3, 2010
This is the test
View test.cs
[TestFixture]
public class WhenCreatedTypeHasBaseTypes
{
IGenerationSession mSession;
[SetUp]
public void Setup()
{
mSession = AutoPocoContainer.Configure(x =>
{
@robashton
robashton / example.cs
Created Jan 4, 2011
Overriding the data source
View example.cs
mResults = mSession.List<SimpleUser>(5)
.Source(x => x.EmailAddress, new DummySource())
.Get();
View gist:773534
var session = AutoPocoContainer.CreateDefaultSession();
var users = session.Collection<SimpleUser>(10, all =>
{
all.Random(5)
.Impose(x => x.FirstName, "Rob")
.Next(5)
.Impose(x => x.FirstName, "Scott");
all.Random(5)
View gist:775219
Hmm, that's the first time time a recruiter has ever refused a request for more information.
Honestly I don't know what you can't give me over e-mail that you have to give me over phone - if you're that worried I'll expend the effort required to go searching for the opportunity directly using whatever meager information about the role you guys normally end up giving then you are clearly are not confident in being able to provide enough value to either myself or the company to warrant your role in the affair.
Sure, I'm doing great on finding work, I'll never normally say no to hearing about other opportunities though - I just draw the line at handing my phone number to recruiters/agents before hearing any details, because while I can easily set up Spam rules in my e-mail, I can't do likewise for phone.
TLDR: If you aren't willing to tell me anything about the opportunity over e-mail, then I will indeed continue on my own course
Thanks,
View gist:776607
public static IEngineConfigurationTypeBuilder<TPoco> Collection<TPoco, TCollection>(
this IEngineConfigurationTypeMemberBuilder<TPoco, TCollection> memberConfig, int min, int max) where TCollection : IEnumerable
{
var collectionType = typeof (TCollection);
// Nefarious, I know - shocking, this will get is Y from X<Y> where X = IEnumerable/List/Etc and Y = Type
// So List<Y> etc
var genericcollectionArgument = collectionType.GetGenericArguments()[0];
// So this will give us AutoSource<Y>
View gist:796761
For<IReportService>()
.AlwaysUnique()
.Singleton()
.Add<ReportService>()
.Named(configuration.Id)
.Ctor<string>("clientId").Is(configuration.Id)
.Ctor<string>("dataServer").Is(configuration.Application.ReportingServer)
.Ctor<string>("databaseName").Is(configuration.Application.ReportingDatabase)
.Ctor<string>("dataUsername").Is(configuration.Application.ReportingUsername)
.Ctor<string>("dataPassword").Is(configuration.Application.ReportingPassword);
View Bootstrapper.cs
public static class Bootstrapper
{
public static void Startup()
{
var documentStore = new EmbeddableDocumentStore
{
Configuration = new RavenConfiguration
{
DataDirectory = "App_Data\\RavenDB",
}
@robashton
robashton / ServiceActionCall.cs
Created Feb 9, 2011
A botched attempt at injecting a validation step to the behaviour onion
View ServiceActionCall.cs
public class ServiceActionCall : ActionCall
{
private readonly ActionCall inner;
public ServiceActionCall(ActionCall inner) : base(inner.HandlerType, inner.Method)
{
this.inner = inner;
}
protected override ObjectDef buildObjectDef()