예제 #1
0
        public static void UpdateStore(this NoSQLContext context, IStoreEntity storeEntity)
        {
            var entity = context.Store.Find(storeEntity.StoreId);

            entity.DateCreated   = storeEntity.DateCreated;
            entity.LastUpdated   = storeEntity.LastUpdated;
            entity.TypeVersionId = storeEntity.TypeVersionId;
            entity.Value         = storeEntity.Value;
        }
예제 #2
0
        public static void AddStore(this NoSQLContext context,IStoreEntity storeEntity)
        {
            var item = context.Store.Create();
            context.Store.Add(item);

            item.StoreId = storeEntity.StoreId;
            item.TypeVersionId = storeEntity.TypeVersionId;
            item.Value = storeEntity.Value;
            item.DateCreated = storeEntity.DateCreated;
            item.LastUpdated = storeEntity.LastUpdated;
        }
예제 #3
0
        public static void AddStore(this NoSQLContext context, IStoreEntity storeEntity)
        {
            var item = context.Store.Create();

            context.Store.Add(item);

            item.StoreId       = storeEntity.StoreId;
            item.TypeVersionId = storeEntity.TypeVersionId;
            item.Value         = storeEntity.Value;
            item.DateCreated   = storeEntity.DateCreated;
            item.LastUpdated   = storeEntity.LastUpdated;
        }
예제 #4
0
        private String ApplyMigrations <T>(IStoreEntity storeEntity)
        {
            //short circuit if migrations are disabled??

            //find the type version for what we have loaded
            var typeVersion = this.ResolveTypeVersion <T>();

            //version mismatch, apply a migration strategy (use decorator???)
            if (typeVersion.TypeVersionId != storeEntity.TypeVersionId)
            {
                //TODO
            }

            //for now just return this JSON
            return(storeEntity.Value);
        }
예제 #5
0
파일: StoreManager.cs 프로젝트: dhtweb/dht
        public void Add(IStoreEntity item)
        {
            var byteArray = item.ToBytes();

            lock (this)
            {
                _count++;
                writer.BaseStream.Seek(_writeIndex, SeekOrigin.Begin);
                writer.Write(_readIndex);
                writer.Write(byteArray.Length);
                writer.Write(byteArray);
                #region 设置文件头
                long wIndex = Position, rIndex = wIndex - LongSize - IntSize - byteArray.Length;
                SetIndex(wIndex, rIndex);
                #endregion
            }
        }
예제 #6
0
        public static void UpdateStore(this NoSQLContext context, IStoreEntity storeEntity)
        {
            var entity = context.Store.Find(storeEntity.StoreId);

            entity.DateCreated = storeEntity.DateCreated;
            entity.LastUpdated = storeEntity.LastUpdated;
            entity.TypeVersionId = storeEntity.TypeVersionId;
            entity.Value = storeEntity.Value;
        }