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
/** | |
* Utility type to replace a string with another. | |
*/ | |
type Replace<S extends string, R extends string, W extends string> = | |
S extends `${infer BS}${R}${infer AS}` | |
? Replace<`${BS}${W}${AS}`, R, W> | |
: S | |
/** | |
* Utility type to remove all spaces and new lines from the provided string. |
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.Threading.Tasks; | |
using System.Web.Mvc; | |
using JetBrains.Annotations; | |
using ShortBus; | |
public abstract class BaseController : Controller | |
{ | |
public IMediator Mediator { get; set; } | |
protected Response<TResult> Query<TResult>(IQuery<TResult> query) |
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 ModularConventionViewEngine : RazorViewEngine | |
{ | |
//This needs to be initialized to the root namespace of your MVC project. | |
//Usually, the namespace of your Global.asax's codebehind will do the trick. | |
private static readonly string RootNamespace = typeof(MvcApplication).Namespace; | |
private static IEnumerable<string> GetPath(ControllerContext controllerContext, string viewName) | |
{ | |
var paths = new List<string>(); |
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
$env:MSBuildEmitSolution=1 | |
msbuild FooBar.sln /t:ValidateSolutionConfiguration | |
$env:MSBuildEmitSolution=0 |
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
// | |
// MethodBaseRocks.cs | |
// | |
// Author: | |
// Jb Evain ([email protected]) | |
// | |
// WARNING: code now lives in http://github.com/jbevain/mono.reflection | |
// | |
// (C) 2009 Novell, Inc. (http://www.novell.com) | |
// |