Exemplo n.º 1
0
        public async Task <IActionResult> Delete(int id)
        {
            context.Remove(context.Courses.Single(c => c.CourseId == id));
            await context.SaveChangesAsync();

            return(RedirectToAction("ListCourses", "Course"));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> DeleteFile(string blobName)
        {
            await service.DeleteBlobAsync(blobName);

            context.Remove(context.Resources.Single(a => a.FileName == blobName));
            await context.SaveChangesAsync();

            return(RedirectToAction("ListResources", "Resources"));
        }