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 WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
config.MapHttpAttributeRoutes(); | |
config.Routes.MapHttpRoute( | |
name: "DefaultApi", | |
routeTemplate: "api/{controller}/{id}", | |
defaults: new { id = RouteParameter.Optional } |
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 RouteConfig | |
{ | |
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.LowercaseUrls = true; | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.IgnoreRoute("{resource}.ashx/{*pathInfo}"); | |
routes.MapMvcAttributeRoutes(); |
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 AutofacConfig | |
{ | |
public static void Register() | |
{ | |
var builder = new ContainerBuilder(); | |
var assembly = Assembly.GetExecutingAssembly(); | |
builder.RegisterModelBinders(assembly); | |
builder.RegisterModelBinderProvider(); | |
//builder.RegisterHubs(assembly); |
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
install-package AutoFac | |
install-package AutoFac.MVC5 | |
install-package Autofac.WebApi2 | |
install-package Autofac.SignalR | |
install-package Microsoft.AspNet.SignalR | |
install-package Microsoft.AspNet.SignalR.Owin | |
install-package EntityFramework |
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
[assembly: OwinStartup(typeof(WebSite))] | |
public partial class Startup | |
{ | |
public void Configuration(IAppBuilder app) | |
{ | |
app.MapSignalR(); | |
} | |
} |
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
<section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/> | |
<couchbase> | |
<servers bucket="default" bucketPassword=""> | |
<add uri="http://127.0.0.1:8091/pools"/> | |
</servers> | |
</couchbase> |
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 CouchbaseConfig | |
{ | |
public static void RegisterModelViews(IEnumerable<Assembly> assemblies) | |
{ | |
var builder = new ViewBuilder(); | |
builder.AddAssemblies(assemblies.ToList()); | |
var designDocs = builder.Build(); | |
var ddManager = new DesignDocManager(); | |
ddManager.Create(designDocs); | |
} |
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.Linq; | |
using System.Web; | |
namespace WebSite.Models | |
{ | |
[Serializable] | |
public abstract class ModelBase |
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 FormatExtensions | |
{ | |
/// <summary> | |
/// Base64 Encode a String | |
/// </summary> | |
/// <param name="input"></param> | |
/// <returns></returns> | |
public static string ToBase64(this string input) | |
{ | |
byte[] toEncodeAsBytes = System.Text.Encoding.Unicode.GetBytes(input); |
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
Install-Package XUnit | |
Install-Package XUnit.Extensions | |
Install-Package AutoFixture | |
Install-Package AutoMapper | |
Install-Package NSubstitute |
OlderNewer