public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var model = await _context.Businesses.FindAsync(id); await _addressServices.GetAll(); if (model == null) { return(NotFound()); } return(View(model)); }
// GET: api/Lookup public HttpResponseMessage Get() { HttpRequestHeaders headers = Request.Headers; bool includeArchived = false; string predicate = string.Empty; if (headers.Contains("includeArchived")) { includeArchived = bool.Parse(headers.GetValues("includeArchived").First()); } var addresses = _addressServices.GetAll(includeArchived); var addressEntities = addresses?.ToList(); return(addressEntities != null && addressEntities.Any() ? Request.CreateResponse(HttpStatusCode.OK, addressEntities) : Request.CreateErrorResponse(HttpStatusCode.NotFound, "Addresses not found")); }