Ejemplo n.º 1
0
        public async Task <ActionResponse> AddMaterial(int courseId, List <DBFile> dbFiles, List <IFormFile> formFiles = null)
        {
            if (courseId != 0 && formFiles != null && formFiles.Count > 0)
            {
                try
                {
                    dbFiles = await _fileService.UploadFiles(formFiles);

                    var res = await _courseService.AddMaterial(courseId, dbFiles);

                    return(res);
                }
                catch (Exception ex)
                {
                    return(new ActionResponse(false, ex.Message));
                }
            }
            return(new ActionResponse(false, "Invalid File or Course Id"));
        }