示例#1
0
        private bool CreateThingRegistryStore()
        {
            TheStorageMirror <TheThing> thingRegistryMirror = new TheStorageMirror <TheThing>(TheCDEngines.MyIStorageService)
            {
                CacheTableName    = "TheThingRegistry",
                IsRAMStore        = false,
                IsCached          = true, //V4.106: This is required until ALL ThingRegistry calls do not go against StorageMirrorCache
                IsCachePersistent = false // New in V4: All nodes can load ThingRegistry - some can store  TheBaseAssets.MyServiceHostInfo.cdeNodeType == cdeNodeType.Relay,
            };
            TheStorageMirrorParameters tStoreParams = new TheStorageMirrorParameters()
            {
                FriendlyName = "cdeTheThingRegistry",
                Description  = "Stores all C-DEngine Things",
                ResetContent = TheBaseAssets.MyServiceHostInfo.IsNewDevice,
                LoadSync     = true
            };
            Task <bool> tRes = thingRegistryMirror.CreateStoreAsync(tStoreParams, null);

            tRes.Wait();
            return(tRes.Result);
        }