public void Add(Models.TextContent content) { content.StoreFiles(); ((IPersistable)content).OnSaving(); var bucket = content.GetRepository().GetClient(); //bucket.Store(StoreMode.Set, "Schema." + content.UUID, content.ToJson()); bucket.ExecuteStore(StoreMode.Set, content.UUID, content.ToJson(), PersistTo.One); ((IPersistable)content).OnSaved(); }
public void Update(Models.TextContent @new, Models.TextContent old) { //if (@new["_id"] == null && old["_id"] != null) //{ // @new["_id"] = old["_id"]; //} @new.StoreFiles(); ((IPersistable)@new).OnSaving(); var bucket = old.GetRepository().GetClient(); bucket.ExecuteStore(StoreMode.Replace, old.UUID, @new.ToJson(), PersistTo.One); ((IPersistable)@new).OnSaved(); }