internal override void AfterSave(DataRootElement data) { // Reload Images from FS foreach (var auction in data.Auctions) { auction.Image = this.LoadBinary(string.Format(CultureInfo.InvariantCulture, "auction-{0}-image1.jpg", auction.Id)); } }
internal override void BeforeSave(DataRootElement data) { // Ensure existence of directory Directory.CreateDirectory(this.binaryDataDirectory); // Remove byte values from images and save individually foreach (var auction in data.Auctions) { this.SaveBinary(string.Format(CultureInfo.InvariantCulture, "auction-{0}-image1.jpg", auction.Id), auction.Image); auction.Image = null; } }
internal override void SaveData(DataRootElement data) { var content = JsonConvert.SerializeObject(data, this.jsonSerializerSettings); File.WriteAllText(this.fullPath, content); }
internal override void BeforeLoad(DataRootElement data) { // Ensure existence of directory Directory.CreateDirectory(this.binaryDataDirectory); }
internal virtual void AfterSave(DataRootElement data) { }
internal virtual void BeforeSave(DataRootElement data) { }
internal virtual void AfterLoad(DataRootElement data) { }
internal virtual void BeforeLoad(DataRootElement data) { }
internal virtual void SaveData(DataRootElement data) { }