Skip to content

Instantly share code, notes, and snippets.

@PeterLehmann
PeterLehmann / IIdentityMap.cs
Created November 10, 2009 08:44
simple identitymap interface
/// <summary>
/// identity map pattern
/// </summary>
/// <typeparam name="T">class</typeparam>
/// <typeparam name="TIdentity">key type there index <typeparamref name="T"/></typeparam>
public interface IIdentityMap<T, TIdentity> where T : class
{
/// <summary>
/// add a product to the map
/// </summary>
@PeterLehmann
PeterLehmann / gist:1006139
Created June 3, 2011 10:18
bug in nsb tests
[Test]
public void TestMessageCast()
{
var id = Guid.NewGuid();
nsTest.Initialize();
nsTest.Handler<CommandHandler>()
.ExpectSend<CreateBookingCommand>(m => m.ShipmentId == id)
.ExpectSend<CreatedShipmentEvent>(m => m.ShipmentId == id)
.OnMessage<CreateShipmentCommand>(m => m.Id = id);
<UserSettings>
<ApplicationIdentity version="10.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment">
<ToolsOptionsSubCategory name="Documents" RegisteredName="Documents" PackageName="Visual Studio Environment Package">
<PropertyValue name="ShowMiscFilesProject">false</PropertyValue>
<PropertyValue name="AutoloadExternalChanges">false</PropertyValue>
<PropertyValue name="CheckForConsistentLineEndings">false</PropertyValue>
<PropertyValue name="SaveDocsAsUnicodeWhenDataLoss">false</PropertyValue>
<PropertyValue name="InitializeOpenFileFromCurrentDocument">true</PropertyValue>
@PeterLehmann
PeterLehmann / .bashrc
Created July 3, 2011 08:40
git bash for windows alias
alias msbuild40=/c/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe
@PeterLehmann
PeterLehmann / gist:1063293
Created July 4, 2011 12:45
log4net default settings nsb, nhibernate
<log4net debug="false">
<appender name="console" type="log4net.Appender.ColoredConsoleAppender">
<mapping>
<level value="Debug" />
<foreColor value="White"/>
</mapping>
<mapping>
<level value="Info" />
<foreColor value="Green"/>
</mapping>
@PeterLehmann
PeterLehmann / promotion.sql
Created December 8, 2011 09:48
promotion default query
select ic.ItemCodeNo
, il.ItemLocalId
, i.ItemNo
, ru.RetailUnitNo
, pil.StartDate
, pil.EndDate
, pp.PromotionPOSNo
, pp.StartDateTime
, pp.EndDateTime
, promotionLineStatus.Code as "promotion line status code"
select
t.name
, i.name
, s.user_seeks
, s.user_scans
, s.user_updates
, s.user_lookups
, s.last_user_seek
, s.last_user_scan
%3 --fname %8 %2 --fname %7 %1 --fname %6 -o %4
use trio;
select commonCodeMaster.CommonCodeMasterId
, commonCodeMaster.commoncodeDomainId
, commonCodeMaster.code
, commonCodeDomain.DomainName
, commonCodeDetail.[Text]
from
commoncodemaster
inner join commoncodedomain on commoncodedomain.commoncodedomainid = commoncodemaster.commoncodedomainid
SELECT i.ItemNo
, ic.InventoryCountingId
, ict.TypeCode InventoryCountingType
, ru.RetailUnitNo RetailUnitNo
, ru.RetailUnitId RetailUnitId
, MAX(ic.InventoryCountingDate) InventoryCountingDate
, MAX(ccmInventoryCountingCauseCode.Code) InventoryCountingCauseCode
, MAX(ccmInventoryCountingDailyStatusCode.Code) InventoryCountingDailyStatusCode
, MAX(ccmItemType.Code) ItemType
, SUM(icd.CountedQty) CountedQty