public ActionResult Preview(string id, string courseID)
        {
            var courseDetails = db.Courses.Find(courseID);
            var courseAssetDetails = db.CourseAssets.Find(id);
            var objViewModel = new previewVideoViewModel();
            objViewModel.AssetGuid = courseAssetDetails.AssetGUid;
            objViewModel.FileName = courseAssetDetails.AssetFileName;
            objViewModel.topicName = courseAssetDetails.AssetHeaderName;
            objViewModel.CourseName = courseDetails.CourseName;
            objViewModel.CreatedTime = courseAssetDetails.CreatedTimeStamp;
            objViewModel.AuthorName = db.CourseUser.First(e => e.UserID == courseDetails.Userid).FirstName;

            return PartialView("_previewVideo", objViewModel);
        }
 public ActionResult Preview(int courseID,int id)
 {
     var objViewModel = new previewVideoViewModel();
     var courseDetails = db.Courses.FirstOrDefault(e => e.CourseID==courseID);
     var courseAssetDetails = db.CourseAssets.FirstOrDefault(e=>e.AssetID==id);
     if(courseDetails!=null && courseAssetDetails !=null)
     {
         objViewModel.AssetGuid = courseAssetDetails.AssetGUid;
         objViewModel.FileName = courseAssetDetails.AssetFileName;
         objViewModel.topicName = courseAssetDetails.AssetHeaderName;
         objViewModel.CourseName = courseDetails.CourseName;
         objViewModel.CreatedTime = courseAssetDetails.CreatedTimeStamp;
         //objViewModel.AuthorName = db.CourseUser.First(e => e.UserID == courseDetails.Userid).FirstName;
         objViewModel.AuthorName = "User";
     }
     else
     {
         objViewModel.FileName = "file not found";
     }
     
     return PartialView("_previewVideo", objViewModel);
 }