This file contains hidden or 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
define([], function() { | |
function FakeLocalStorage() { | |
var self = this; | |
self.length = 0; | |
self.keys = []; | |
return self; | |
} |
This file contains hidden or 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 ConfigureToUseSqlite(this IKernel kernel) | |
{ | |
var nHibernateConfiguration = Substitute.For<INHibernateConfiguration>(); // custom interface | |
var msSqlConfiguration = SQLiteConfiguration.Standard | |
.InMemory() | |
.ShowSql() | |
; | |
nHibernateConfiguration.GetPersistenceConfiguration().Returns(msSqlConfiguration); |
This file contains hidden or 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 InjectionBinding | |
{ | |
public Type RegistrationKey { get; set; } | |
public IList<object> Implementations { get; set; } | |
public Type[] GetImplementationTypes() | |
{ | |
return Implementations.Select(row => row.GetType()).ToArray(); | |
} | |
} | |
This file contains hidden or 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
[Test] | |
public void ApiDocumentation() | |
{ | |
// Arrange | |
var builder = Substitute.For<IBuilder>(); | |
builder.Create<string>().From(5.0m).Returns("Five"); | |
// Act | |
var result = builder.Create<string>().From(5.0m); | |
This file contains hidden or 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 interface ICommand<in TRequest, out TResponse> : IDisposable | |
{ | |
TResponse Execute(TRequest request); | |
} | |
/// <summary> | |
/// Use Request.Empty when the command doesn't need any arguments. | |
/// </summary> | |
public class Request | |
{ |
This file contains hidden or 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 interface IMapper | |
{ | |
IMapperLink From<TInput>(TInput input); | |
} | |
public interface IMapperLink | |
{ | |
TOutput To<TOutput>(); | |
} |
This file contains hidden or 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 interface IRepository : IDisposable | |
{ | |
IQueryable<T> Find<T>() where T: class; | |
T Get<T>(object key) where T : class; | |
void Save(object value); | |
void Delete(object value); |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
IlMerges an assembly with its dependencies. Depends on nuget being installed in the PATH. | |
.PARAMETER targetProject | |
The name of the project to be ilmerged | |
.PARAMETER outputAssembly | |
The name of the ilmerged assembly when it is created |
This file contains hidden or 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
Hub.ConnectionOpening += (sender, args) => | |
{ | |
// your code here | |
}; | |
Hub.ConnectionClosing += (sender, args) => | |
{ | |
// your code here | |
}; |
This file contains hidden or 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
ObservableProviderConfiguration.RegisterProvider("System.Data.SqlServerCe.4.0", setAsDefault:true); |