public ActionResult Delete(string id, AppDevBusiness appdevbusiness) { if (ModelState.IsValid) { appdevbusiness.DeletePhoto("images", id); } return(RedirectToAction("Index")); }
public async Task <ActionResult> DeleteAsync(string id, AppDevBusiness appDevBusiness, string uriLink) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Student student = await DocumentDBRepository <Student> .GetItemAsync(id); string link = "https://appdevproject3.blob.core.windows.net/images" + id; if (link == uriLink) { appDevBusiness.DeletePhoto("images", id); } if (student == null) { return(HttpNotFound()); } return(View(student)); }