This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assembly = Assembly.GetCallingAssembly(); | |
var actionMethods = assembly.GetTypes() | |
// Find all non abstract classes of type Controller and whose names end with "Controller" | |
.Where(x => x.IsClass && !x.IsAbstract && x.IsSubclassOf(typeof(TwilioController)) && x.Name.EndsWith("Controller")) | |
// Find all public methods from those controller classes | |
.SelectMany(x => x.GetMethods().Where(m => m.DeclaringType.Name == x.Name), (x, y) => new { Controller = x.Name.Substring(0, x.Name.Length - 10), Method = y.Name }); | |
foreach (var action in actionMethods) { | |
routes.MapRoute(action.Method, action.Method, new { controller = action.Controller, action = action.Method }); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="xhrproxy.js"></script> | |
<script> | |
setupXHRProxy(); | |
</script> | |
</head> |
NewerOlder