Exemple #1
0
        private static Task DeleteFile(HttpRequest request, HttpResponse response, RouteData routeData, IFiles files)
        {
            var file = routeData.GetString("file");

            response.StatusCode = files.Delete(file) ? 200 : 404;

            return(Task.CompletedTask);
        }
        public IActionResult Delete(int id)
        {
            var Employee = _Employee.GetById(id);

            _Employee.Delete(Employee);

            var allemployeefiles = _File.Find(x => x.EmployeeID == id);

            foreach (var item in allemployeefiles)
            {
                _File.Delete(item);
            }
            return(RedirectToAction(nameof(Index)));
        }
Exemple #3
0
 public static bool Delete(int id)
 {
     return(dal.Delete(id));
 }