View gist:2363853
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
Configuration smtpServerConfiguration = new Configuration(); | |
smtpServerConfiguration.SetPort(25); | |
smtpServerConfiguration.SetServer("smtp.8bitclockwork.com"); | |
smtpServerConfiguration.SetTimeout(60); |
View gist:2363890
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
Configuration smtpServerConfiguration = new Configuration(); | |
smtpServerConfiguration | |
.SetPort(3) | |
.SetServer("bob") | |
.SetTimeout(333); |
View gist:2363900
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
class Configuration | |
{ | |
private String _server { get; set; } | |
private int _timeout { get; set; } | |
private int _port { get; set; } | |
public Configuration SetPort(int port) | |
{ | |
_port = port; | |
return this; |
View gist:2380461
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
var result = session | |
.Query<Wine>() | |
.Where(p => p.Id == wineId)) | |
.First() |
View gist:2582109
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
var x = 10; | |
var y = "2"; | |
var result = x * y; |
View HTTP Request
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
HTTP/1.0 304 Not Modified | |
Date: Wed, 09 May 2012 00:26:52 GMT | |
Content-Type: text/html; charset=UTF-8 | |
Last-Modified: Tue, 08 May 2012 23:51:26 GMT | |
Age: 113 | |
X-Cache: HIT from cp1015.eqiad.wmnet | |
X-Cache-Lookup: HIT from cp1015.eqiad.wmnet:3128 | |
X-Cache: MISS from cp1011.eqiad.wmnet | |
X-Cache-Lookup: MISS from cp1011.eqiad.wmnet:80 | |
Connection: keep-alive |
View gist:2831427
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
dynamic expando = new ExpandoObject(); | |
expando.Title = "Ceci est un titre"; | |
expando.Nom = "Paradis"; | |
expando.Prenom = "Pascal"; | |
foreach (var e in (IDictionary<String, Object>) expando) | |
{ | |
Console.WriteLine(e.Value); | |
} |
View gist:2831441
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
dynamic expando = new ExpandoObject(); | |
expando.Title = "Ceci est un titre"; | |
expando.Nom = "Paradis"; | |
expando.Prenom = "Pascal"; |
View gist:2885531
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
dynamic urlDictionnary = new UrlDictionnary(); | |
urlDictionnary.HomePage = "http://www.parad.is"; | |
urlDictionnary.About = "http://frenchcoding.wordpress.com/about/"; | |
urlDictionnary.Blog = "http://frenchcoding.wordpress.com"; |
View gist:2921048
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 UrlDictionnary : DynamicObject | |
{ | |
Dictionary<string, string> dictionary = new Dictionary<string, string>(); | |
public int Count | |
{ | |
get | |
{ | |
return dictionary.Count; | |
} |
OlderNewer