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.Collections.Generic; | |
| using System.Data.Entity; | |
| using System.Linq; | |
| using Moq; | |
| namespace Test.Common.Mock.Repository | |
| { | |
| public abstract class MockBaseRepository<T, TEntity> : Mock<T> | |
| where TEntity : class, IEntity | |
| where T : BaseRepository<TEntity> |
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 NamespaceConstraint : ActionMethodSelectorAttribute | |
| { | |
| public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) | |
| { | |
| var dataTokenNamespace = (string)controllerContext.RouteData.DataTokens.FirstOrDefault(dt => dt.Key == "Namespace").Value; | |
| var actionNamespace = methodInfo?.DeclaringType?.FullName; | |
| return dataTokenNamespace == actionNamespace; | |
| } | |
| } |
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.IO; | |
| using System.Linq; | |
| using System.Reflection; | |
| using System.Web.Compilation; | |
| //Add to AssemblyInfo [assembly: PreApplicationStartMethod(typeof(ApplicationDynamicDiscovery), "Discover")] | |
| namespace Web | |
| { | |
| public static class ApplicationDynamicDiscovery |
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 Ninject; | |
| using System; | |
| using System.Web.Mvc; | |
| namespace Factories | |
| { | |
| public class NinjectControllerFactory : DefaultControllerFactory | |
| { | |
| public IKernel Kernel { get; private 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.Diagnostics; | |
| using System.Linq.Expressions; | |
| using System.Net; | |
| using System.Net.Http; | |
| using System.Reflection; | |
| using System.Runtime.CompilerServices; | |
| using System.Threading.Tasks; | |
| using System.Web.Http.ModelBinding; |
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.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| using Microsoft.AspNet.Identity; | |
| using Microsoft.AspNet.Identity.Owin; | |
| namespace Common | |
| { | |
| public class CustomAuthAttribute : AuthorizeAttribute |
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
| // ref: http://stackoverflow.com/a/1293163/2343 | |
| // This will parse a delimited string into an array of | |
| // arrays. The default delimiter is the comma, but this | |
| // can be overriden in the second argument. | |
| function CSVToArray( strData, strDelimiter ){ | |
| // Check to see if the delimiter is defined. If not, | |
| // then default to comma. | |
| strDelimiter = (strDelimiter || ","); | |
| // Create a regular expression to parse the CSV values. |
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
| var lr = require('tiny-lr'), | |
| gulp = require('gulp'), | |
| nib = require('nib'), | |
| jade = require('gulp-jade'), | |
| stylus = require('gulp-stylus'), | |
| livereload = require('gulp-livereload'), | |
| myth = require('gulp-myth'), | |
| csso = require('gulp-csso'), | |
| imagemin = require('gulp-imagemin'), | |
| uglify = require('gulp-uglify'), |
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 abstract class Logger : IDisposable | |
| { | |
| private LogVerbosity _verbosity; | |
| private Queue<Action> _queue = new Queue<Action>(); | |
| private ManualResetEvent _hasNewItems = new ManualResetEvent(false); | |
| private ManualResetEvent _terminate = new ManualResetEvent(false); | |
| private ManualResetEvent _waiting = new ManualResetEvent(false); | |
| private Thread _loggingThread; | |
| private static readonly Lazy<Logger> _lazyLog = new Lazy<Logger>(() => { |