Exemplo n.º 1
0
        public async Task <ApiResponse <IEnumerable <Video> > > GetVideosByVideoType(Guid videoTypeAssociatedId, string typeName)
        {
            ApiResponse <VideoType> videoTypeResponse = new ApiResponse <VideoType>();

            videoTypeResponse = await _videoTypeService.GetVideoTypeByName(typeName);

            var response = new ApiResponse <IEnumerable <Video> >();
            IEnumerable <Video> video = await _videoRepository.FindAllAsync(x => x.VideoTypeId == videoTypeResponse.Data.Id && x.VideoTypeAssociatedId == videoTypeAssociatedId);

            if (video == null)
            {
                response.Success = false;
                return(response);
            }
            response.Success = true;
            response.Data    = video;
            return(response);
        }