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 Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
using System.Web; |
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
public class HandlebarHelper | |
{ | |
public static void RegisterHelper() | |
{ | |
RegisterArrayContainsHelper(); | |
} | |
/// <summary> | |
/// {{#arrayContains List<> limit}} | |
/// ... if condition true |
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
/// <summary> | |
/// Database Initializer that will Drop/Create databases that are currently in use | |
/// </summary> | |
/// <typeparam name="TContext">Data Context</typeparam> | |
public class ForceDeleteInitializer<TContext> : IDatabaseInitializer<TContext> where TContext : DbContext | |
{ | |
private readonly IDatabaseInitializer<TContext> _initializer; | |
public ForceDeleteInitializer() | |
{ |
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
public class CsvFileActionResult<T> : System.Web.Mvc.ActionResult | |
{ | |
public string FileName { get; set; } | |
public IEnumerable<T> List { get; set; } | |
protected virtual void Write(IEnumerable<T> list, TextWriter output) | |
{ | |
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(T)); | |
foreach (PropertyDescriptor prop in props) |
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
public class CandidateSignatureHandler : IHttpHandler | |
{ | |
public bool IsReusable | |
{ | |
get { return false; } | |
} | |
public void ProcessRequest(HttpContext context) | |
{ | |
ICandidateDocument _candidateDocHandler = AppDefaults.Get<ICandidateDocument>(); |
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
public static class ListExtension | |
{ | |
public static IEnumerable<TObject> Intersect<TObject>(this IEnumerable<TObject> source, IEnumerable<TObject> destination, Func<TObject, TObject, bool> predicate) | |
{ | |
var result = new List<TObject>(); | |
foreach (var sourceObject in source) | |
{ | |
foreach (var destinationObject in destination) | |
{ | |
if (predicate(sourceObject, destinationObject)) |
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
public class EmailProvider : IEmailProvider | |
{ | |
private readonly SmtpClient smtpClient = null; | |
private readonly IEmailTemplateRepository _emailRepository; | |
private bool disposed = false; | |
private EmailProvider() | |
{ | |
smtpClient = new SmtpClient(); | |
} |
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
public class Notifications | |
{ | |
public string SendNotification(GcmNotiInputModel model) | |
{ | |
try | |
{ | |
string GoogleAppID = Config.BrowserKey; | |
var SENDER_ID = Config.SenderId; |
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
public static string GenerateSEOFriendlyUrl(string uncleanUrl) | |
{ | |
//Trim Start and End Spaces. | |
uncleanUrl = uncleanUrl.Trim(); | |
//Trim "-" Hyphen | |
uncleanUrl = uncleanUrl.Trim('-'); | |
uncleanUrl = uncleanUrl.ToLower(); | |
char[] chars = @"$%#@!*?;:~`+=()[]{}|\'<>,/^&"".".ToCharArray(); | |
//Replace . with - hyphen | |
uncleanUrl = uncleanUrl.Replace(".", "-"); |
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
<!DOCTYPE html5> | |
<html lang="en"> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<style type="text/css"> | |
.main-container { | |
} | |
</style> |