Exemple #1
0
        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;

        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public void TestInit()
 {
     _app = AppFactory.Empty();
 }
Exemple #4
0
 public void Delete(IFirebaseApp app)
 {
     var entity = app.Child(this.Path + "/" + this.Key);
     entity.Remove();
 }
Exemple #5
0
        public void Delete(IFirebaseApp app)
        {
            var entity = app.Child(this.Path + "/" + this.Key);

            entity.Remove();
        }
Exemple #6
0
 public void TestInit()
 {
     // sets root URL to https://example.com/
     _app = AppFactory.Empty();
 }