Skip to content

Instantly share code, notes, and snippets.

View TWolverson's full-sized avatar
🏠
Working from home

TWolverson

🏠
Working from home
View GitHub Profile
using System;
public class Program
{
public static void Main()
{
var 個 = "";
Console.WriteLine("Hello World");
}
}
public static class Helpers
{
// this method must be non-async because the caller doesn't understand Tasks
// it also must be static for *reasons*
public static string GetApplicationValue(string appType, string listType, string key)
{
RefreshCache(); // this needs to block so that the cache is refreshed before trying to return a result
// pseudocode
return Cache.SingleOrDefault(item => item.Key == key);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
using System;
using System.Globalization;
public class CustomersController
{
private readonly IQueryable<Customer> customersQuery;
public CustomersController(IQueryable<Customer> customersQuery)
{
this.customersQuery = customersQuery;
}
public Customer Get(int id)
public class StreetController : BaseControllerType<Street> {
// is the intention to type these as BaseControllerType<House> or BaseControllerType<BaseEntityType> ?
private readonly HouseController houseController;
private readonly LightController lightController;
public ActionResult Update(Street street){
foreach(var house in street.Houses){
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Poly
{
enum X
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace MCVE
{
class Program
{
static void Main(string[] args)
@TWolverson
TWolverson / gist:a0446603654abaeb4114
Last active August 29, 2015 14:13
Micro ORM as single method
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
public class ReferenceValuesService{
public ReferenceValuesService(Func<Context> contextFactory){
this.contextFactory = contextFactory;
this.referenceValues = new Lazy<IEnumerable<ReferenceValue>>(() => this.contextFactory().GetReferenceValues());
}
public IEnumerable<ReferenceValue> ReferenceValues(){
return this.referenceValues.Value;
}
keydown keyCode=16 which=16 charCode=0
keydown keyCode=192 which=192 charCode=0
keypress keyCode=64 (@) which=64 (@) charCode=64 (@)
keyup keyCode=192 which=192 charCode=0
keyup keyCode=16 which=16 charCode=0
keydown keyCode=16 which=16 charCode=0
keydown keyCode=222 which=222 charCode=0
keypress keyCode=126 (~) which=126 (~) charCode=126 (~)
keyup keyCode=222 which=222 charCode=0
keyup keyCode=16 which=16 charCode=0