public ActionResult Delete(int id)
        {
            UserLibrary library = _repository.GetById(id);

            if (library != null)
            {
                _repository.Remove(library);

                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                return(new BadRequestResult());
            }
        }
 public void Delete(int id)
 {
     _repository.Remove(_repository.GetById(id));
 }