Skip to content

Instantly share code, notes, and snippets.

@michaelaird
michaelaird / JS-LINQ.js
Created January 20, 2020 13:47 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
@michaelaird
michaelaird / Proxy.tst
Created October 10, 2017 00:25
Create api proxy with dependencies
${
using Typewriter.Extensions.WebApi;
using Typewriter.Extensions.Types;
string ReturnType(Method m) => m.Type.Name == "IHttpActionResult" ? "void" : m.Type.Name;
string ServiceName(Class c) => c.Name.Replace("Controller", "Gateway");
string ParentServiceName(Method m) => ServiceName((Class)m.Parent);
static List<String> VisitedTypes = new List<String>();
static List<String> VisitedEnums = new List<String>();
public abstract class FormElement2
{
public Guid Id { get; set; }
public int Order { get; set; }
}
public abstract class FieldControl2 : FormElement2
{
public string Label { get; set; }
public string Trailer { get; set; }