Пример #1
0
 public ActionResult Delete(string id, AppDevBusiness appdevbusiness)
 {
     if (ModelState.IsValid)
     {
         appdevbusiness.DeletePhoto("images", id);
     }
     return(RedirectToAction("Index"));
 }
Пример #2
0
        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));
        }