public void Index() { // Arrange HomeController controller = new HomeController(); // Act var query = new ZoneQuery(); ViewResult result = controller.Index(query) as ViewResult; // Assert Assert.AreEqual("(Giraffes by name, monkeys by nature).", result.ViewBag.Message); }
public ActionResult Index(ZoneQuery query) { if (ModelState.IsValid) { Console.WriteLine(query.Address); if (!string.IsNullOrEmpty(query.Address) || !string.IsNullOrEmpty(query.LatLong)) { return(RedirectToAction("Search", query)); } } ViewBag.Message = "(Giraffes by name, monkeys by nature)."; return(View()); }
// // POST: /Home/Search //[HttpPost] public ActionResult Search(ZoneQuery query) { if (ModelState.IsValid) { var service = new GironkeyService(); // ViewBag.Result = service.GetDataForAddress(query.Address); // query.LatLong = "115.90114501745099,-31.915819563332345"; // query.LatLong = "115.802821,-31.940334"; if (!string.IsNullOrEmpty(query.LatLong)) { ViewBag.Result = service.CallLandgate(query.LatLong); // .CallLandgateGetJson(); } Console.WriteLine(query.Address); } return(View(query)); }
public async Task <List <Zone> > GetZones(ZoneQuery query) { return(await this.client.Get <List <Zone> >(zonesController, query)); }
public Task <Zone> FindZoneById(int zoneId, ZoneQuery query) { throw new NotImplementedException(); }
public async Task <ActionResult <List <Zone> > > GetZones( [FromServices] IZoneService zoneService, [FromQuery] ZoneQuery query) { return(await zoneService.GetZones(query)); }
public ZoneQuery Zone([Inject] ZoneQuery entityQuery) { return(entityQuery); }