Пример #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"));
        }
Пример #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"));
        }