Skip to content

Instantly share code, notes, and snippets.

@theoutlander
Created June 29, 2015 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theoutlander/f4b53d2b0164685bcc00 to your computer and use it in GitHub Desktop.
Save theoutlander/f4b53d2b0164685bcc00 to your computer and use it in GitHub Desktop.
Servicestack date issue
using System;
using System.Diagnostics;
using Funq;
using ServiceStack;
using ServiceStack.Text;
namespace ServiceStackBugs
{
class Program
{
static void Main(string[] args)
{
new AppHost().Init().Start("http://*:8088/");
"ServiceStack SelfHost listening at http://localhost:8088 ".Print();
Process.Start("http://localhost:8088/");
Console.ReadLine();
}
}
[Route("/test")]
public class Test
{
public DateTime? Date { get; set; }
}
public class AppHost : AppSelfHostBase
{
/// <summary>
/// Default constructor.
/// Base constructor requires a name and assembly to locate web service classes.
/// </summary>
public AppHost()
: base("ServiceStackBugs", typeof(MyServices).Assembly)
{
}
/// <summary>
/// Application specific configuration
/// This method should initialize any IoC resources utilized by your web service classes.
/// </summary>
/// <param name="container"></param>
public override void Configure(Container container)
{
}
}
public class MyServices : Service
{
public object Any(Test request)
{
Console.WriteLine(request.Date);
return request;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment