public static bool clearAllWords() { try { container.ExecuteStoreCommand("delete from WordSet"); //container.Refresh(System.Data.Objects.RefreshMode.StoreWins, container.WordSet); container = new SearchEngineModelContainer(); return(true); } catch (Exception ee) { throw ee; } }
public static bool clearAllDocuments() { try { container.ExecuteStoreCommand("delete from DocumentSet"); //while (container.DocumentSet.Count() > 0) //{ // container.DocumentSet.DeleteObject(container.DocumentSet.First()); //} //container.Refresh(System.Data.Objects.RefreshMode.StoreWins, container.DocumentSet); container = new SearchEngineModelContainer(); return(true); } catch (Exception ee) { throw ee; //return false; } }