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
<Query Kind="Program"> | |
<Namespace>System.Globalization</Namespace> | |
</Query> | |
void Main() | |
{ | |
Func<string,string> ToTitleCase= new CultureInfo("en-US",false).TextInfo.ToTitleCase; | |
var stepMethods = new List<string>(); | |
var classSb = new StringBuilder(); | |
classSb.AppendLine("using System;"); |
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.Data; | |
using System.Linq; | |
using System.Reflection; | |
using Autofac; | |
using NHibernate; | |
using NHibernate.Cfg; | |
using NHibernate.Connection; | |
using NHibernate.Dialect; |
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.ComponentModel.DataAnnotations.Schema; | |
using System.IO; | |
using System.Xml; | |
using System.Xml.Serialization; | |
using System.Data.Entity; | |
namespace EfWithXmlConsoleApplication | |
{ | |
class Program |
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 Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Table; | |
using NServiceBus; | |
using NServiceBus.UnitOfWork; | |
namespace MyCommon.UnitOfWorkManagers | |
{ | |
public interface IBaseMessage |
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
This Page Intentionally Left Blank |
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
<Query Kind="Program"> | |
<Reference><RuntimeDirectory>\System.ServiceProcess.dll</Reference> | |
<Reference><RuntimeDirectory>\System.Configuration.Install.dll</Reference> | |
<Reference><RuntimeDirectory>\System.Windows.Forms.dll</Reference> | |
<Namespace>System.ServiceProcess</Namespace> | |
<Namespace>Microsoft.Win32</Namespace> | |
</Query> | |
void Main() | |
{ |
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 YourApplicationDbContextBase : DbContext | |
{ | |
//... | |
public override int SaveChanges() | |
{ | |
var changeSet = ChangeTracker.Entries<IAuditable>(); | |
if (changeSet != null) | |
SetAuditDetails(changeSet); |
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
//iife - Immediately Invoked Function Expression (JS) | |
(function(){ | |
$END$ | |
})();; | |
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
Feature: Error handling in asp.net | |
Errors occur in web apps and we need to be able to handle the exceptions (e.g. log them) and show customers appropriate messages in a meaning full and consistent manner. | |
These test assume Accept:text/html or equivalent | |
#RHYSC -I don't mind how the error information is surfaced but it should be accessible in a common and clean manner | |
#these specs can be extrapolated out to the other error codes too | |
Scenario: 404 on static files | |
Given a static file ~/test.html does not exist | |
When we navigating to ~/test.html | |
Then the on error event should be raised by XYZ with path information and 404 http status code |
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 InlineFileAttribute : ActionFilterAttribute | |
{ | |
private const string ContentDisposition = "Content-Disposition"; | |
public override void OnResultExecuted(ResultExecutedContext filterContext) | |
{ | |
var headers = filterContext.HttpContext.Response.Headers; | |
if (!string.IsNullOrWhiteSpace(headers[ContentDisposition])) | |
headers[ContentDisposition] = headers[ContentDisposition].Replace("attachment", "inline"); | |
base.OnResultExecuted(filterContext); |