public async Task <IActionResult> RemoveFiles([FromRoute] long id) { var certificate = await _context.UserCertificates .Include(x => x.File) .SingleOrDefaultAsync(x => x.Id == id); _fileWorker.RemoveFile(certificate.File.Path); _context.FileDescriptions.Remove(certificate.File); await _context.SaveChangesAsync(); return(Ok()); }