Skip to content

Instantly share code, notes, and snippets.

View jeffora's full-sized avatar

Jeff Burn jeffora

  • Sydney, Australia
View GitHub Profile
public void UploadTheInternet() {
// uploading...
DoUploads();
}
@jeffora
jeffora / MyServiceClass.cs
Created April 26, 2012 02:23
Topshelf service
namespace MyService
{
class MyServiceClass
{
public void Start() {
// start timer etc
}
public void Stop() {
// stop timer etc
@jeffora
jeffora / gist:1243959
Created September 27, 2011 01:02
Massive dynamic issues
// Example 1:
// conn has a compile time type of DbConnection, as this is what is returned by OpenConnection
// cmd has compile time type of DbCommand, as this is what is returned by CreateCommand
// Both have runtime types of the more specific SqlConnection/SqlCommand
public static dynamic DynamicWeirdness() {
using (var conn = OpenConnection()) {
var cmd = CreateCommand("SELECT * FROM Products");
cmd.Connection = conn;
}
Console.WriteLine("It worked!");