예제 #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);
        }
예제 #2
0
        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)));
        }
예제 #3
0
 public static bool Delete(int id)
 {
     return(dal.Delete(id));
 }