Skip to content

Instantly share code, notes, and snippets.

View lukesmith's full-sized avatar

Luke Smith lukesmith

View GitHub Profile
[Serializable]
public class EmailAddressType : IUserType
{
public SqlType[] SqlTypes
{
get
{
var types = new SqlType[1];
types[0] = new SqlType(DbType.String);
[Serializable]
public class EmailAddress : IComparable<EmailAddress>
{
public const int MaxLength = 256;
// Regex based on Phil Haacks http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx
public const string Expression = @"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|uk)\b";
private readonly string value;
public EmailAddress(string value)
{
<?xml version="1.0" encoding="utf-8" ?>
<commands>
<command name="CreateUserCommand">
<username>lukesmith</username>
<password>password1</password>
<firstname>Luke</firstname>
<lastname>Smith</lastname>
<emailaddress>[email protected]</emailaddress>
</command>
<command name="CreateUserCommand">
using System;
using System.Linq;
namespace BookUpon.Tests
{
public static class IMappedEngineConfigurationBuilderExtensions
{
public static void ScanAssembly<T>(this IMappedEngineConfigurationBuilder builder)
{
var maps = typeof(T).Assembly.GetTypes().Where(x => typeof(IAutoPocoMap<>).IsAssignableFrom(x) && !x.IsAbstract);
this.For<IRepository<ICommandLog>>()
.Use(x => {
var session = x.GetInstance<ISessionFactory>().OpenSession();
session.FlushMode = FlushMode.Commit;
return new CommandLogRepository(new NHibernateUnitOfWork(session));
});