/// <summary>
        /// 添加一个临时素材。
        /// </summary>
        /// <param name="temporaryMaterialService">临时素材服务。</param>
        /// <param name="bytes">素材内容。</param>
        /// <returns>添加临时素材的结果模型。</returns>
        public static AddTemporaryMaterialResultModel AddTemporary(this ITemporaryMaterialService temporaryMaterialService, byte[] bytes)
        {
            var type = MaterialHelper.GetMaterialType(bytes);

            return(temporaryMaterialService.NotNull("temporaryMaterialService").AddTemporary(bytes, type));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加一个其他类型的永久素材。
        /// </summary>
        /// <param name="foreverMaterialService">永久素材服务。</param>
        /// <param name="bytes">素材内容。</param>
        /// <returns>添加素材的结果模型。</returns>
        public static AddMaterialResultModel AddOther(this IForeverMaterialService foreverMaterialService, byte[] bytes)
        {
            var type = MaterialHelper.GetMaterialType(bytes);

            return(foreverMaterialService.NotNull("foreverMaterialService").AddOther(bytes, type));
        }