/// <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) { var lastPart = GetFileExtensionFromMimeType(mimeType); var fileName = $"{pictureId:0000000}_0.{lastPart}"; var filePath = lastPart.Equals("pdf") ? GetPdfLocalPath(fileName) : GetPictureLocalPath(fileName); return(_fileProvider.ReadAllBytes(filePath)); }