Skip to content

Instantly share code, notes, and snippets.

View mikanyg's full-sized avatar
☁️
Enjoying the startup life

Mikael Nygaard mikanyg

☁️
Enjoying the startup life
View GitHub Profile
@mikanyg
mikanyg / ResourceNotFoundAttribute.cs
Last active May 2, 2017 22:37
WebApi ActionFilter used in conjunction with Service Fabric reverse proxy or ServiceFabric.AutoRest to indicate a RESTfull 404 response.
using System;
using System.Net;
using System.Web.Http.Filters;
namespace ServiceFabric.WebApi.Filters
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public class ResourceNotFoundAttribute : ActionFilterAttribute
{
public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)