public ActionResult GenerateTables() { var all = _tables.GetAll(); if (!all.Any()) { for (int i = 0; i < 10; i++) { var cmd = new CreateTable { Id = _idGenerator.Generate(), BuyIn = 1000 + (i * 100), SmallBlind = 5 + (((i + 1) / 5) * 10), Name = "Table #" + (i + 1) }; Send(cmd); } return(Content("success!")); } return(Content("already created")); }
public ActionResult GetAll() { var model = _tables.GetAll().OrderBy(x => x.Players.Count); return(Json(model)); }