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 static void Main() | |
{ | |
// 1. Instantiate the IWindsor container object | |
var container = new WindsorContainer(); | |
// 2. Register the services and the respective components that implement them | |
container.Register( | |
Component.For( typeof( IHtmlTitleRetriever ) ).ImplementedBy( typeof(HtmlTitleRetriever) ) , | |
Component.For( typeof( IHtmlTitleRetriever ) ).ImplementedBy( typeof(AnotherHttpFileDownloader ) ) | |
); |
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
[Fact] | |
public void GetAfterPostReturnsCorrectStatusCodeWithPostedEntry() | |
{ | |
using (var client = MyHttpClientFactory.Create()) | |
{ | |
var json = new | |
{ | |
time = DateTimeOffset.Now | |
, | |
distance = 8500 |
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
[Fact] | |
public void GetAfterPostReturnsCorrectStatusCodeWithPostedEntry() | |
{ | |
using (var client = MyHttpClientFactory.Create()) | |
{ | |
var json = new | |
{ | |
time = DateTimeOffset.Now | |
, | |
distance = 8500 |
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 Program | |
{ | |
static void Main() | |
{ | |
Person person = new Person(); | |
string dateOfBirth = "10 May 1989"; | |
Console.WriteLine(person.GetAge(dateOfBirth)); | |
} | |
} |
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 void SomeMethod(ISomeInterface interface) | |
{ | |
interface.DoSomething(); | |
} |
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 void SomeMethod(SomeObject obj) | |
{ | |
obj.DoSomething(); | |
} |
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
try | |
{ | |
//Code to perform some operation | |
} | |
catch | |
{ | |
//Code to handle any exception that occurred in the try block | |
throw; // the throw keyword will pass or throw the exception to the calling method | |
} |
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
try | |
{ | |
//Code to perform some operation | |
} | |
catch | |
{ | |
//Code to handle any exception that occurred in the try block | |
// No throw statement | |
} |
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
try | |
{ | |
//Code to perform some operation which could raise an exception | |
} | |
catch | |
{ | |
//Code to handle any exception that occurred in the try block | |
} |
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
SELECT | |
dataInt -- this is the "Content" node id | |
FROM [someTable].[dbo].[cmsPropertyData] PD | |
INNER JOIN cmsMember mb on PD.contentNodeId = mb.nodeId | |
WHERE LoginName = 'someLoginName' | |
AND dataInt IS NOT NULL | |
AND PD.propertyTypeId = the document type id of the "Content" node (see cmsPropertyType table) |