public void AddToIndex(string address) { if (string.IsNullOrEmpty(address)) { return; } var ownerIndex = new OwnerIndexItem() { Address = address }; database.SaveOwnerIndex(ownerIndex); IndexOwnerCache.AddOrUpdate(ownerIndex); }
public OwnerIndexItem Get() { var cachedIndex = IndexOwnerCache.Get(); if (cachedIndex != null) { return(cachedIndex); } var index = database.GetOwnerIndex(); if (index != null) { IndexOwnerCache.AddOrUpdate(index); } return(index); }
public void DeleteIndex() { database.DeleteOwnerIndex(); IndexOwnerCache.Remove(); }