private void InitializeLazyLoad(File file) { if (file == null) { throw new ArgumentNullException("file"); } file.FileStream = new Lazy <Stream>(() => FileStorageUtilities.LoadFile(file)); }
private void Store(File file, bool updateMode) { if (file == null) { throw new ArgumentNullException("file"); } if (file.FileStream == null || file.FileStream.Value == null) { return; } FileStorageUtilities.StoreFile(file); }
private void Delete(File file) { if (file == null) { throw new ArgumentNullException("file"); } if (string.IsNullOrEmpty(file.StoragePath)) { return; } if (!HasAnotherEntity(file)) { FileStorageUtilities.DeleteFile(file); } }