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
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] | |
public class LoggingAttribute : InterceptAttribute | |
{ | |
public override IInterceptor CreateInterceptor(IProxyRequest request) | |
{ | |
return request.Kernel.Get<LoggingInterceptor>(); | |
} | |
} |
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 LoggingInterceptor : IInterceptor | |
{ | |
public void Intercept(IInvocation invocation) | |
{ | |
try | |
{ | |
Console.WriteLine("Start"); | |
invocation.Proceed(); | |
Console.WriteLine("Success!"); | |
} |
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 AppModule : NinjectModule | |
{ | |
public override void Load() | |
{ | |
Bind<ITaxType>().To<SalesTax>(); | |
} | |
} |
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 SalesTax : ITaxType | |
{ | |
public virtual decimal Calculate(decimal subTotal) | |
{ | |
return Math.Round(subTotal * 1.0825m, 2, MidpointRounding.ToEven); | |
} | |
} |
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 interface ITaxType | |
{ | |
decimal Calculate(decimal subTotal); | |
void ErrorMethod(); | |
} |
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
require 'tipster' | |
Tipster.new('/path/to/repository').html_report |
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
@model MVC3Layouts.Models.Person | |
@{ | |
ViewBag.Title = "Index"; | |
Layout = "~/Views/Home/_Layout.cshtml"; | |
} | |
<h2>Index</h2> | |
<h3>Person Information</h3> |
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 HomeController : Controller | |
{ | |
private Person p = new Person(); | |
public ActionResult Index() | |
{ | |
p.FirstName = "Robert"; | |
p.LastName = "Greiner"; | |
p.TwitterHandle = "@robert_greiner"; | |
return View(p); |
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 Person { | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
public string TwitterHandle { get; set; } | |
} |
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 html> | |
<html> | |
<head> | |
<title>@ViewBag.Title</title> | |
</head> | |
<body> | |
<h1>This is the Home Layout page!</h1> | |
<div> | |
@RenderBody() | |
</div> |