Example #1
0
        public async Task AddTest()
        {
            var fake         = Mock.Of <IVideosRepo>();
            var videoService = new VideosService(fake);

            var video = new Video()
            {
                Desc = "desc", Url_Video = "url", TherapyId = "1"
            };
            await videoService.AddAndSave(video);
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("Id,Desc,Url_Video,TherapyId")] Video video)
        {
            if (ModelState.IsValid)
            {
                await _videosService.AddAndSave(video);

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TherapyId"] = new SelectList(_videosService.getTherapies(), "Id", "Id", video.TherapyId);
            return(View(video));
        }