示例#1
0
        /// <summary>
        /// Loads a picture from file
        /// </summary>
        /// <param name="pictureId">Picture identifier</param>
        /// <param name="mimeType">MIME type</param>
        /// <returns>Picture binary</returns>
        protected virtual byte[] LoadPictureFromFile(int pictureId, string mimeType)
        {
            string lastPart = GetFileExtensionFromMimeType(mimeType);
            string fileName = $"{pictureId:0000000}_0.{lastPart}";
            string filePath = GetPictureLocalPath(fileName);

            return(_fileProvider.ReadAllBytes(filePath));
        }