Beispiel #1
0
        public async Task <IActionResult> Get_Video_By_CateId(long cateId)
        {
            try
            {
                var category = await _categoryManager.FindById(cateId);

                string folder = Extensions.NormalVNese(category.Name);
                var    data   = await _mediasManager.Get_List((int)StatusEnum.Active, (int)MediaTypeEnum.Video, folder, 40, 1);

                if (data == null)
                {
                    throw new Exception(MessageConst.DATA_NOT_FOUND);
                }
                return(Ok(data));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }