public JsonResult GetVideos(VideoSearchModel searchModel)
        {
            var result = new StatusModel<List<VideoDataTableModel>>();
            var videoBL = new VideoBL();
            result = videoBL.GetVideos(searchModel);

            if (result.Success)
            {
                //return Json(result.Data);
                return Json(new { data = result.Data }, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json(new List<VideoModel>());
            }
        }
        /// <summary>
        /// method that return all relevant videos
        /// </summary>
        /// <param name="searchModel">model contains all the search parameters</param>
        /// <returns>succes/nor and relevant videos</returns>
        public StatusModel<List<VideoDataTableModel>> GetVideos(VideoSearchModel searchModel)
        {
            var result = new StatusModel<List<VideoDataTableModel>>(true);
            try
            {

                using (var repository = new Repository())
                {
                    result.Data = repository.VideoRepository.SearchVideos(searchModel.Name, searchModel.Director, searchModel.Genre, searchModel.Year).Select(v => new VideoDataTableModel(v)).OrderBy(v=>v.IsRented).ThenByDescending(v=>v.Year).ToList();
                }

            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Message = "unexepcted Error";
            }

            return result;
        }