Skip to content

Instantly share code, notes, and snippets.

// credit RAM && BrianRogers -- https://stackoverflow.com/questions/26162902/how-can-i-do-json-serializer-ignore-navigation-properties/#32797274
namespace DataModel
{
class CustomResolver : DefaultContractResolver
{
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
{
JsonProperty prop = base.CreateProperty(member, memberSerialization);
var propInfo = member as PropertyInfo;
if (propInfo != null)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Domain.Logic
{
public class FeatureToggleHelper
{
@Segment0895
Segment0895 / WebApiProxyClient.cs
Created December 14, 2017 12:39
Transparently Proxy WebApi Call
public static async Task<IHttpActionResult> CriarPedidoAsyncTransparente<X, Y>(X pedido, string path)
{
HttpResponseMessage resp2 = await client.PostAsJsonAsync("/api/" + path, pedido);
ResponseMessageResult msg2 = new ResponseMessageResult(resp2);
return msg2;
}
@Segment0895
Segment0895 / generateNuget.bat
Created August 23, 2016 16:58
generate Nupkg from a folder full of DLL, one DLL per Nupkg
@echo off
:lib
mkdir BUILD
cd BUILD
mkdir lib
cd ..
cd INCOMING_DLL
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using log4net;
namespace DesignByContractProgramming
{