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
// Ordinary | |
public class SimpleDto : ValueObject<SimpleDto> | |
{ | |
public string Value { get; set; } | |
} | |
// With base class | |
public abstract class BaseDto<T> : ValueObject<T> | |
{ | |
public string BaseValue { get; set; } |
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
using System; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using Xunit; |
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
using System; | |
using System.Data.Entity.Core.Common.CommandTrees; | |
using System.Data.Entity.Core.Metadata.Edm; | |
using System.Data.Entity.Infrastructure.Interception; | |
using System.Linq; | |
public class CreatedAndModifiedDateInterceptor : IDbCommandTreeInterceptor | |
{ | |
public const string CreatedColumnName = "Created"; | |
public const string ModifiedColumnName = "Modified"; |
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
module WebApi2Helpers | |
// Port of answer by @nikosbaxevanis :- http://stackoverflow.com/a/19954215/11635 | |
open System | |
open Ploeh.AutoFixture | |
open Ploeh.AutoFixture.Kernel | |
open Ploeh.AutoFixture.Xunit | |
open Ploeh.AutoFixture.AutoFoq | |
open System.Web.Http.Hosting |
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
[ModuleDependency(typeof(ServiceContainerInitialization))] | |
[InitializableModule] | |
public class DependencyResolverInitialization : IConfigurableModule | |
{ | |
public void ConfigureContainer(ServiceConfigurationContext context) | |
{ | |
context.Container.Configure(ConfigureContainer); | |
GlobalConfiguration.Configuration.Routes.MapHttpRoute( | |
name: "DefaultApi", |
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
// usage: <app-dbl-text ng-model="model.name"></app-dbl-text> | |
app.directive('appDblText', function ($compile, $parse) { | |
return { | |
restrict: 'E', | |
template: '<div><span></span><input type="text" ng-model="ngModel" class="form-control" style="display:none;"></div>', | |
replace: true, | |
link: function(scope, elem, attrs) { | |
var model = attrs.ngModel; | |
var spans = elem.find('span'); | |
var inputs = elem.find('input'); |
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
param( | |
[parameter(Mandatory=$true)] | |
[string] | |
$ravenUrl, | |
[parameter(Mandatory=$true)] | |
[string] | |
$backupDir, | |
[parameter(Mandatory=$true)] | |
[string] | |
$ravenBackupTool, |
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 class CacheHelper | |
{ | |
/// <summary> | |
/// Returns cache value or default(T) if no value in cache | |
/// </summary> | |
/// <typeparam name="T">Type of cached value</typeparam> | |
/// <param name="key">Cache key for cached value</param> | |
/// <returns>Cached value</returns> | |
public static T Get<T>(string key) | |
{ |