November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
You can do it by SQL
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP (1000)
[StoreName]
FROM [dbo].[tblBigTable]
group by StoreName
Hi Jesper,
I think you need to find all the class that inherited the "IDynamicData" and then you can loop through them to retrieve the stores
EPiServer.Data.Dynamic.DynamicDataStoreFactory.Instance.GetStore(typeof(StoreClass))
You can use StoreDefinition.GetAll() to get all the StoreDefinition, then use DynamicDataStoreFactory.Instance.GetStore(storeDefinition.StoreName)
@Jesper, is tool going to be public? Don't mind to join forces and add feature to this tool - https://github.com/Geta/DdsAdmin?
Hi,
StoreDefinition.GetAll() did the trick, thx Quan.
This is my code for retrieving our data stores and removing selected store. Im filtering on our applications main namespece to remove all stores not created by us.
public List<DynamicDataStore> GetStores {
var mainNamespace = Assembly.GetExecutingAssembly().GetName().Name;
var ddsStores = new List<DynamicDataStore>();
var storeDefinitions = StoreDefinition.GetAll().Where(x => x.StoreName.Contains(mainNamespace));
foreach (var storeDefinition in storeDefinitions)
{
ddsStores.Add(DynamicDataStoreFactory.Instance.GetStore(storeDefinition.StoreName));
}
return ddsStores;
}
public void DeleteStoreAndAllItems(string storeName)
{
DynamicDataStoreFactory.Instance.DeleteStore(storeName, true);
}
Hi,
I need to get a list of all types or names of the stores in the DDS. Im developing a tool to delete unused stores and it would be nice to be able to present them in a list. Anybody got any idée on how to do it?
Regards
Jesper