I hereby claim:
- I am frankgeerlings on github.
- I am frankgeerlings (https://keybase.io/frankgeerlings) on keybase.
- I have a public key whose fingerprint is 91E7 11EE 229F 94B4 2444 1FB2 A7A6 F879 006D F9EB
To claim this, I am signing this object:
using System; | |
public static class Extensions | |
{ | |
public static TResult With<TResult, TObject>(this TObject self, Func<TObject, TResult> func) where TObject : class | |
{ | |
return self == null ? default(TResult) : func(self); | |
} | |
/// <summary> |
I hereby claim:
To claim this, I am signing this object:
private static Func<DateTime> now = () => DateTime.Now; | |
public static Func<DateTime> Now | |
{ | |
get | |
{ | |
return now; | |
} | |
set |
using System; | |
public static class StreamExtensions | |
{ | |
// http://stackoverflow.com/questions/1080442/how-to-convert-an-stream-into-a-byte-in-c | |
public static byte[] ReadToEnd(this System.IO.Stream stream) | |
{ | |
var originalPosition = stream.Position; | |
stream.Position = 0; |
public static class HtmlExtensions | |
{ | |
public static IHtmlString DropDownListFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, Dictionary<string, IEnumerable<SelectListItem>> selectList) | |
{ | |
/* | |
* <select name="tmodel"> | |
* <optgroup title="Items"> | |
* <option value="item">Item</option> | |
* </select> | |
*/ |
<system.net> | |
<mailSettings> | |
<smtp deliveryMethod="Network" from="someaddress@example.com"> | |
<network | |
host="mail.example.com" | |
userName="something@example.com" | |
password="*************" | |
port="25" /> | |
</smtp> | |
</mailSettings> |
#language: nl | |
Functionaliteit: Een nieuwe feature | |
Om domme fouten te voorkomen | |
Als wiskundemalloot | |
Wil ik de som van twee getallen optellen | |
Scenario: Optellen | |
Stel ik heb 50 op de rekenmachine ingevoerd | |
En ik heb 70 op de rekenmachine ingevoerd | |
Als ik op optellen druk |
using System; | |
using System.Linq; | |
using System.Web; | |
public class ImageHttpHandler : IHttpHandler | |
{ | |
21public bool IsReusable | |
{ | |
get | |
{ |
using System; | |
using System.Linq.Expressions; | |
using System.Web.Mvc; | |
public static class ActionDescriptorDescribesActionExtension | |
{ | |
public static bool DescribesAction<TController>(this ActionDescriptor self, Expression<Func<TController, object>> action) where TController : IController | |
{ | |
var actionName = | |
(action.Body is UnaryExpression |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Text.RegularExpressions; | |
using System.Web.Mvc; | |
/// <summary> | |
/// Model metadata property names are typically CamelCased. When used as a human-readable text, eg. in LabelFor etc, this metadata provider | |
/// will un-camelcase the name of the property, so you don't have to add a DisplayNameAttribute to every single property in your model. | |
/// </summary> |