コード例 #1
0
        public void AddToIndex(string address)
        {
            if (string.IsNullOrEmpty(address))
            {
                return;
            }

            var ownerIndex = new OwnerIndexItem()
            {
                Address = address
            };

            database.SaveOwnerIndex(ownerIndex);
            IndexOwnerCache.AddOrUpdate(ownerIndex);
        }
コード例 #2
0
        public OwnerIndexItem Get()
        {
            var cachedIndex = IndexOwnerCache.Get();

            if (cachedIndex != null)
            {
                return(cachedIndex);
            }

            var index = database.GetOwnerIndex();

            if (index != null)
            {
                IndexOwnerCache.AddOrUpdate(index);
            }
            return(index);
        }
コード例 #3
0
 public void DeleteIndex()
 {
     database.DeleteOwnerIndex();
     IndexOwnerCache.Remove();
 }