public IFirebase Save(IFirebaseApp app) { if (this.Key != null && this.Key != "") { //remove old version first (not very pretty but Firebase change events are pain in tha butt) var entity = app.Child(this.Path + "/" + this.Key); entity.Remove(); } else { this.CreatedAt = DateTime.Now; } var newEntity = app.Child(this.Path); this.UpdatedAt = DateTime.Now; this.Revision = Guid.NewGuid().ToString(); IFirebase result = newEntity.Push(this); this.Key = result.Key; return result; }
public IFirebase Save(IFirebaseApp app) { if (this.Key != null && this.Key != "") { //remove old version first (not very pretty but Firebase change events are pain in tha butt) var entity = app.Child(this.Path + "/" + this.Key); entity.Remove(); } else { this.CreatedAt = DateTime.Now; } var newEntity = app.Child(this.Path); this.UpdatedAt = DateTime.Now; this.Revision = Guid.NewGuid().ToString(); IFirebase result = newEntity.Push(this); this.Key = result.Key; return(result); }
public void TestInit() { _app = AppFactory.Empty(); }
public void Delete(IFirebaseApp app) { var entity = app.Child(this.Path + "/" + this.Key); entity.Remove(); }
public void TestInit() { // sets root URL to https://example.com/ _app = AppFactory.Empty(); }