Skip to content

Instantly share code, notes, and snippets.

View ferventcoder's full-sized avatar
🎯
Focusing

Rob Reynolds ferventcoder

🎯
Focusing
View GitHub Profile
Public Function GetSwapNumber(ByVal session As ISession, ByVal instrument As Instrument) As String
Dim swapNumber As String = String.Empty
Dim crit As DetachedCriteria = DeCrit.UniqueSwapAssignmentByInstrumentId(instrument)
Dim swapAssignments As IList(Of SwapAssignment)
Dim newSession As ISession = session.GetSession(EntityMode.Poco)
swapAssignments = crit.GetExecutableCriteria(newSession).List(Of SwapAssignment)()
For Each swap As SwapAssignment In swapAssignments
If (swap.Swap IsNot Nothing) Then
public class TradeMapping : ClassMap<Trade>
{
public TradeMapping()
{
HibernateMapping.Schema("dbo");
Table("Trades");
Not.LazyLoad();
HibernateMapping.DefaultAccess.Property();
HibernateMapping.DefaultCascade.SaveUpdate();
We couldn’t find that file to show.
@ferventcoder
ferventcoder / TeamCity NuGet auto deploy
Created March 25, 2011 17:14
This is a command line custom script build step for Team City to auto deploy your NuGet packages once built
xcopy code_drop\nuget\*.nupkg somewhere\Packages /r /i /c /h /k /e /y
@ferventcoder
ferventcoder / RoundhousEMigrate.cs
Created May 18, 2011 04:28
RoundhousE - Migrations with new semi-fluent interface
new Migrate().Set(p =>
{
p.ConnectionString = connectionString;
p.SqlFilesDirectory = scriptsLocation;
p.EnvironmentName = environmentName;
p.Drop = dropDatabase;
p.RecoveryModeSimple = useSimpleRecoveryMode;
p.Restore = restore;
p.RestoreFromPath = restorePath;
p.RepositoryPath = repositoryPath;
@ferventcoder
ferventcoder / DropkicKSecurity.cs
Created June 2, 2011 20:55
DropkicK Security settings
DeploymentStepsFor(File, s =>
{
s.Security(o =>
{
o.ForPath(settings.InstallPath, p =>
{
p.GrantRead(settings.UserGroupA);
p.GrantReadWrite(settings.UserGroupB);
p.Grant(Rights.ReadWrite, settings.UserGroupA);
@ferventcoder
ferventcoder / TheDeployment.cs
Created June 9, 2011 17:47
DropkicK Deployment Example
using System.IO;
using System.Security.Cryptography.X509Certificates;
using dropkick.Configuration.Dsl;
using dropkick.Configuration.Dsl.Files;
using dropkick.Configuration.Dsl.Iis;
using dropkick.Configuration.Dsl.RoundhousE;
using dropkick.Configuration.Dsl.Security;
using dropkick.Configuration.Dsl.WinService;
using dropkick.Wmi;
@ferventcoder
ferventcoder / setup.cmd
Created July 26, 2011 20:22
Setting up a development environment with chocolatey
@echo off
SET DIR=%~dp0%
@PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "& '%DIR%setup.ps1' %*"
pause
@ferventcoder
ferventcoder / Moq.cs
Created July 29, 2011 21:47
Moq Issue
mock.Verify(m => m.Subscribe<Message>(someclass.SomeMethod, null, x => true), Times.AtLeastOnce());
@ferventcoder
ferventcoder / 1Q_ForEachSafeNullCheck.cs
Created August 2, 2011 16:50
IEnumerable Null Safeguard Extension - Useful When Iterating (ForEach Loop)
foreach (var item in items ?? new List<string>())
{
//do something
}