public void AddComic(ComicData comicData) { using (var trans = Realm.BeginWrite()) { Realm.Add(comicData, true); trans.Commit(); } }
public void DeleteComic(ComicData comicData) { LocalImageService.DeleteImage(comicData.Id); using (var trans = Realm.BeginWrite()) { // Delete pages and then comic (so comic data isn't invalidated before it's pages can be delete) Realm.RemoveRange(comicData.Pages); Realm.Remove(comicData); trans.Commit(); } }