Skip to content

Instantly share code, notes, and snippets.

public class TransitTimeCalculator
{
public IList<TransitTimeResponse> UpsGround()
{
var ret = new List<TransitTimeResponse>();
Upsrates Rates1 = new Upsrates();
Rates1.UPSAccount.AccessKey = {myKey}; //removed for security purposes
Rates1.UPSAccount.AccountNumber = {myAcctNumber};
public class UserRepository
{
public UserRepository(IUnitOfWork uow) : (uow)
{ }
public bool Authenticate(UserLogin userLogin)
{
var user = DbConnExec<User>((con) =>
con.Select<User>(user =>
user.UserName == userLogin.UserName && user.Password == userLogin.Password
@paaschpa
paaschpa / gist:5405028
Created April 17, 2013 15:02
Test Console App for this SO question - http://stackoverflow.com/questions/16057527/servicestack-hitting-the-wrong-http-verb. Tested using Fiddler to make requests.
class Program
{
static void Main(string[] args)
{
var appHost = new AppHost();
appHost.Init();
appHost.Start("http://*:1337/");
System.Console.WriteLine("Listening on http://localhost:1337/ ...");
System.Console.ReadLine();
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
@paaschpa
paaschpa / gist:5305198
Created April 3, 2013 20:55
Trying to use IronPython to run ServiceStack...need to figure out how to register a ServiceStack service.
import clr
clr.AddReferenceToFile('ServiceStack.dll')
clr.AddReferenceToFile('ServiceStack.ServiceInterface.dll')
clr.AddReferenceToFile('ServiceStack.Text.dll')
clr.AddReferenceToFile('Services.dll')
from System import *
from ServiceStack.WebHost.Endpoints import AppHostHttpListenerBase
from MarkdownSharp import *
from ServiceStack.ServiceInterface import *
@paaschpa
paaschpa / Web.config.bad
Created March 6, 2013 16:35
Web.config.bad causes 'ServiceStack.Factory' error when making request to /servicestack/hello in ServiceStack.Hello example project running under IISExpress in Classic mode. Web.config.good runs successfully after adding '.aspx' extenstions to ServiceStack routes and making request to /servicestack/hello.aspx
<?xml version="1.0"?>
<configuration>
<!-- ServiceStack: Required to host at: /servicestack -->
<location path="servicestack">
<system.web>
<httpHandlers>
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
</httpHandlers>
</system.web>