This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using System; | |
using System.Runtime.CompilerServices; | |
namespace DisposableValueTuples | |
{ | |
[MemoryDiagnoser] | |
public class Benchmark | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /reservations | |
{ | |
"hotel": "S01543", | |
"reservationNumber": "123456", | |
"confirmationNumber": "654321", | |
"status": "Booked", | |
"arrivalDate": "2017-03-24", | |
"departureDate": "2017-03-26", | |
"room": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace NoNamespace | |
{ | |
public static class FuncExtensions | |
{ | |
public static Func<T> ToFunc<T>(this Lazy<T> lazyValue) | |
{ | |
if (lazyValue == null) | |
throw new ArgumentNullException("lazyValue"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Xml.Linq; | |
using NHibernate; | |
namespace NHibernate | |
{ | |
public static class SessionFactoryExtensions | |
{ | |
public static XElement GetStatisticsXml(this ISessionFactory sessionFactory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using log4net.Core; | |
using Microsoft.WindowsAzure.Storage.Table; | |
namespace WindowsAzure.Logging | |
{ | |
/// <summary> | |
/// There used to be a dedicated log table entity class for derived from <see cref="TableEntity" /> | |
/// Because TableEntity uses a lot of reflection, I switched it to a DynamicTableEntity which uses a dictionary of properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Employee | |
{ | |
public virtual int Id { get; set; } | |
public virtual string Name { get; set; } | |
public virtual Employee Manager { get; set; } | |
private int _age; | |
public virtual int Age | |
{ | |
get { return _age; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
namespace ConsoleApplication3 | |
{ | |
class Program | |
{ | |
static volatile IEnumerable<int> results; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using System.Web.Mvc; | |
using NHibernate; | |
using NHibernate.Linq; | |
public static class SelectListExtensions |