This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// interfaces | |
public interface IResult<T> | |
{ | |
T GetResult(); | |
} | |
public interface IEntityQuerier | |
{ | |
void Execute(ISession session, Guid parameter); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IUnitOfWork | |
{ | |
void Register(IWorkItem workItem); | |
void Commit(); | |
void Rollback(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
so_pk.name as PrimaryKeyTable | |
, sc_pk.name as PrimaryKeyColumn | |
, so_fk.name as ForeignKeyTable | |
, sc_fk.name as ForeignKeyColumn | |
from | |
sysforeignkeys sfk | |
inner join sysobjects so on so.id = sfk.constid | |
inner join sysobjects so_pk on sfk.rkeyid = so_pk.id | |
inner join sysobjects so_fk on sfk.fkeyid = so_fk.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1. set up script tables | |
-- create drop unique constraint statements | |
declare @drop_unique_constraints table ([sql] nvarchar(max)) | |
insert into @drop_unique_constraints | |
select 'alter table [' + tables.name + '] drop constraint ' + so.name | |
from sys.objects so | |
join information_schema.constraint_column_usage iscon on so.name = iscon.constraint_name | |
join sys.columns columns on so.parent_object_id = columns.object_id | |
and iscon.column_name = columns.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
powershell -NoProfile -ExecutionPolicy unrestricted -Command "& {Import-Module '.\lib\psake\psake.psm1'; invoke-psake -t default;}" | |
pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[auth] | |
bb1.prefix = https://bitbucket.org/ | |
bb1.username = {{personal username}} | |
bb1.password = {{personal password}} | |
bb2.prefix = https://bitbucket.org/{{work account}}/ | |
bb2.username = {{work username}} | |
bb2.password = {{work password}} | |
bb3.prefix = https://{{work username}}@bitbucket.org/{{work account}}/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// old method | |
public override T[] Filter<T>(IEnumerable<T> filterableObjects) | |
{ | |
var filteredObjects = new List<T>(); | |
string[] searchTerms = GetCommaDelimitedSearchTerms(); | |
foreach (T filterableObject in filterableObjects) | |
{ | |
object[] values = _criterion.GetValues(filterableObject); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path(File.dirname(__FILE__) + '/edgecase') | |
# Greed is a dice game where you roll up to five dice to accumulate | |
# points. The following "score" function will be used calculate the | |
# score of a single roll of the dice. | |
# | |
# A greed roll is scored as follows: | |
# | |
# * A set of three ones is 1000 points |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string Prettify(this Type type) | |
{ | |
var provider = new Microsoft.CSharp.CSharpCodeProvider(); | |
return provider.GetTypeOutput(new System.CodeDom.CodeTypeReference(type)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class IdToEntityConverterTester : TestBase | |
{ | |
[Test] | |
public void Should_load_entity() | |
{ | |
Guid userId = Guid.NewGuid(); | |
var user = new User(); | |
var repository = S<IUserRepository>(); |