View NumericalExtensions.cs
using System; | |
namespace SimonGilbert.Blog | |
{ | |
public static class NumericalExtensions | |
{ | |
public static double RoundByDecimalPlaces(this double number, int numberOfDecimalPlaces = 2) | |
{ | |
return Math.Round(number, numberOfDecimalPlaces); | |
} |
View DateTimeExtensions.cs
using System; | |
namespace SimonGilbert.Blog | |
{ | |
public static class DateTimeExtensions | |
{ | |
public static string ToRelativeDate(this DateTime dateTime) | |
{ | |
var timeSpan = DateTime.Now - dateTime; |
View UnifiedController.cs
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
namespace SimonGilbert.Blog.Controllers | |
{ | |
public class UnifiedController : Controller | |
{ | |
[HttpGet] | |
public IActionResult Index() | |
{ |