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.Linq; | |
using System.Web.Mvc; | |
using System.Web.WebPages; | |
public static class IsomorphicRazorExtensions | |
{ | |
public static HelperResult Foreach<T>(this HtmlHelper helper, IEnumerable<T> items, Func<T, HelperResult> template) | |
where T : class, new() |
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.IO; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace Your.Project.Helpers | |
{ |
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.Collections.Generic; | |
using System.Text.RegularExpressions; | |
namespace Your.Web.Project | |
{ | |
public static class FilterHelper | |
{ | |
public static bool HasOption(string query, string option) | |
{ | |
var regex = GetRegex(option); |
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.Globalization; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.ValueProviders; | |
public class MultipartFormDataValueProvider : IValueProvider | |
{ |
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
// Workaround for Postal.MVC5 1.2.0 issue 73 | |
// https://github.com/andrewdavey/postal/issues/73 | |
if (HttpContext.Current == null) | |
{ | |
var baseURL = ConfigurationManager.AppSettings["baseURL"].TrimEnd('/'); | |
var absolute = VirtualPathUtility.ToAbsolute("~/").TrimStart('/'); | |
HttpContext.Current = new HttpContext( | |
new HttpRequest("", baseURL + "/" + absolute, ""), | |
new HttpResponse(new StringWriter()) |
NewerOlder