Skip to content

Instantly share code, notes, and snippets.

@alecwhittington
alecwhittington / ISampleQuery.cs
Created May 8, 2011 17:30
Sample Implementation of NHQuery
namespace QueryTest.Domain.Contracts.Queries
{
using SharpArch.Domain.PersistenceSupport;
public interface ISampleQuery : IQuery<Address> { }
}
public class ProductViewModel
{
public string Name { get; set; }
public int Id { get; set; }
public string CategoryName { get; set; }
}
@alecwhittington
alecwhittington / PropertyConvention.cs
Created June 16, 2011 15:20
Fluent NHibernate - Data Annotation Conventions
namespace YourProjectName.Here.NHibernateMaps.Conventions
{
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using DataAnnotationsExtensions;
using FluentNHibernate.Conventions.Instances;
@alecwhittington
alecwhittington / MyTaskTests.cs
Created September 29, 2011 15:19
Testing a Task
[TestFixture]
public class MyTaskTests
{
private MyTask sut;
private IRepository<Help> helpRepository;
private IAnotherRepository anotherRepository;
[Test]
public void My_Sample_Test()
@alecwhittington
alecwhittington / ServiceLocatorInitializer.cs
Created September 30, 2011 15:03
ServiceLocatorInitializer
public class ServiceLocatorInitializer
{
#region Public Methods
public static void Init()
{
IWindsorContainer container = new WindsorContainer();
container.AddComponent("validator", typeof(IValidator), typeof(ValidatorStub));
container.AddComponent("validatorManager", typeof(IValidationManager), typeof(ValidationManagerStub));
ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container));