Skip to content

Instantly share code, notes, and snippets.

@dlumpp
dlumpp / BetterJsonResult.cs
Last active July 9, 2018 16:48
[BetterJsonResult] An MVC JsonResult using Newtonsoft serialization to create friendlier JSON #MVC #JSON
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using System.Web;
using System.Web.Mvc;
using System;
namespace MyMvcApp.ActionResults
{
public class BetterJsonResult : JsonResult
@dlumpp
dlumpp / ShouldHavePropertyValuesEqualTo.cs
Last active July 9, 2018 16:49
[Shouldy Deep Compare] A Shouldly extension to perform a recursive, memberwise compare of two object's public property values #testing #Shouldly
using System;
using System.Collections;
namespace Shouldly
{
static class ShouldlyExtensions
{
public static void ShouldHavePropertyValuesEqualTo(this object actual, object expected)
{
foreach (var prop in expected.GetType().GetProperties())