Skip to content

Instantly share code, notes, and snippets.

@daberni
daberni / ElasticObject.cs
Created January 30, 2019 19:33
C# ElasticObject which never fails
public class ElasticObject : DynamicObject
{
private IDictionary<string, object> members = new Dictionary<string, object>();
private IDictionary<int, object> indexes = new Dictionary<int, object>();
public ElasticObject()
{
}

Routing and MVC

ASP.NET MVC uses the Routing middleware to match the URLs of incoming requests and map them to actions. Routes are defined in startup code or using attributes and describe how URL paths should be matched to actions. MVC also uses the same set of routes to generate URLs to include as links in responses.

This document will explain the interactions between MVC and routing, and how typical MVC applications make sure of routing features. See the for details on how to write more advanced routes.

Setting up Routing Middleware

In your Configure method you may see code like:

@daberni
daberni / plex-update.sh
Last active September 15, 2018 17:48
plex-update.sh
sudo ls && \
(( \
(git clone https://aur.archlinux.org/plex-media-server.git) \
|| \
(cd plex-media-server && git pull && cd ..) \
) && cd plex-media-server && makepkg -si) ; cd .. ; rm -rf plex-media-server