public OutputData Insert(IInputData input, object instance)
        {
            WeMaterialUploadObject mediaObject = instance.Convert <WeMaterialUploadObject>();
            WeVideoMaterial        material    = new WeVideoMaterial(mediaObject.ServerPath, mediaObject.Title, mediaObject.Introduction);
            var res = material.Add();

            return(OutputData.CreateToolkitObject(KeyData.Empty));
        }
        public OutputData Insert(IInputData input, object instance)
        {
            WeMaterialUploadObject mediaObject = instance.Convert <WeMaterialUploadObject>();

            byte[] fileData = File.ReadAllBytes(mediaObject.ServerPath);
            string fileName = "";

            if (string.IsNullOrEmpty(mediaObject.Name))
            {
                fileName = mediaObject.FileName;
            }
            else
            {
                fileName = mediaObject.Name + Path.GetExtension(mediaObject.FileName);
            }

            WeOtherMaterial material = new WeOtherMaterial(fileName, fileData);
            var             res      = material.Add();

            return(OutputData.CreateToolkitObject(KeyData.Empty));
        }