protected AnnotationFile(string fileName, string contentType, byte[] fileContent)
 {
     FileName    = AnnotationHelper.EnsureValidFileName(fileName);
     MimeType    = contentType;
     FileSize    = new FileSize(fileContent.Length > 0 ? Convert.ToUInt64(fileContent.Length) : 0);
     _annotation = new Lazy <Entity>(() => null, LazyThreadSafetyMode.None);
     _getStream  = () => new MemoryStream(fileContent);
 }
 protected AnnotationFile(HttpPostedFileBase file)
 {
     FileName    = AnnotationHelper.EnsureValidFileName(file.FileName);
     MimeType    = file.ContentType;
     FileSize    = new FileSize(file.ContentLength > 0 ? Convert.ToUInt64(file.ContentLength) : 0);
     _annotation = new Lazy <Entity>(() => null, LazyThreadSafetyMode.None);
     _getStream  = () => file.InputStream;
 }