Skip to content

Instantly share code, notes, and snippets.

View Allon-Guralnek's full-sized avatar

Allon Guralnek Allon-Guralnek

  • ANZ Bank
  • Melbourne, Australia
  • 04:20 (UTC +10:00)
View GitHub Profile
@Allon-Guralnek
Allon-Guralnek / paket.lock
Created February 9, 2018 12:29
Paket lock file when using Paket v5.134.0 causing Newtonsoft.Json 10 to be resolved instead of 9 (as per loweset_matching)
REDIRECTS: ON
COPY-CONTENT-TO-OUTPUT-DIR: ALWAYS
CONTENT: ONCE
RESTRICTION: == net451
NUGET
remote: https://www.nuget.org/api/v2
Castle.Core (4.2.1)
DataAnnotationsValidator (2.1)
FluentAssertions (5.0)
System.ValueTuple (>= 4.3)
// OUTPUT:
//
// QueueTask() was called for task = 403
// TryExecuteTaskInline() was called for task = 403
//
// === Non - completed task block START ===
// TryExecuteTaskInline() was called for task = 412
// QueueTask() was called for task = 412
// === Non - completed task block END ===
//
SELECT
[Project4].[ID] AS [ID],
[Project4].[C2] AS [C1],
[Project4].[Title] AS [Title],
[Project4].[C1] AS [C2],
[Project4].[AuthorID] AS [AuthorID],
[Project4].[Title1] AS [Title1],
[Project4].[Revision] AS [Revision],
[Project4].[CreatedUTC] AS [CreatedUTC],
[Project4].[Body] AS [Body]
@Allon-Guralnek
Allon-Guralnek / gist:3488271
Created August 27, 2012 13:07
Generated SQL for `.FirstOrDefault()` (for http://stackoverflow.com/questions/12138353/)
SELECT
[Project4].[ID] AS [ID],
[Project4].[C1] AS [C1],
[Project4].[AuthorID] AS [AuthorID],
[Project4].[Title] AS [Title],
[Project4].[Revision] AS [Revision],
[Project4].[CreatedUTC] AS [CreatedUTC],
[Project4].[Body] AS [Body]
FROM ( SELECT
[Filter1].[ID] AS [ID],
@Allon-Guralnek
Allon-Guralnek / gist:3488126
Created August 27, 2012 12:49
Create tables and data for test database 'Wiki' (for http://stackoverflow.com/questions/12138353/)
IF OBJECT_ID('Articles', 'U') IS NOT NULL DROP TABLE Articles
IF OBJECT_ID('Authors', 'U') IS NOT NULL DROP TABLE Authors
CREATE TABLE Authors
(
ID INT NOT NULL IDENTITY,
Name NVARCHAR(100) NOT NULL,
CONSTRAINT PK_Authors PRIMARY KEY CLUSTERED (ID)
)
using System;
using System.Diagnostics.Contracts;
using System.Linq.Expressions;
using System.Reflection;
public class DynamicPropertyAccessor<TObject, TProperty>
{
public string Name { get; private set; }
public Type PropertyType { get; private set; }