Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
namespace WebApplication1.Controllers
public class RandomController : Controller
public async Task<JsonResult> Get()
var rand = new Random();
await Task.Delay(rand.Next(0, 50)); // Emulate tiny latency...
return new JsonResult(new {
numbers = Enumerable.Range(1, 10)
.Select(i => i * rand.NextDouble())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment