} // Fetch public static CmsPersistentVariable[] FetchAll() { PersistentVariableRepository repository = new PersistentVariableRepository(); List <CmsPersistentVariable> allVariables = repository.GetAll() as List <CmsPersistentVariable>; return(allVariables.ToArray()); } // FetchAll
public void CanQueryByPrefix() { PersistentVariableRepository persistencevariableRepository = new PersistentVariableRepository(); CmsPersistentVariable[] variableArray = persistencevariableRepository.FetchAllWithNamePrefix("LastPeriodicTaskStartTime_HatCms.Admin"); Assert.That(variableArray.Length, Is.EqualTo(3)); }
public void CanCustomRepository() { PersistentVariableRepository persistencevariableRepository = new PersistentVariableRepository(); HatCMS.CmsPersistentVariable variable = persistencevariableRepository.FetchbyName("LastPeriodicTaskStartTime_HatCms.Admin.BackgroundTasks.EmailConfigErrors"); Assert.That(variable.Name, Is.EqualTo("LastPeriodicTaskStartTime_HatCms.Admin.BackgroundTasks.EmailConfigErrors")); }
public static void Delete(CmsPersistentVariable persistentVariableToDelete) { PersistentVariableRepository repository = new PersistentVariableRepository(); repository.Delete(persistentVariableToDelete); } // Delete
} // FetchAll public static CmsPersistentVariable[] FetchAllWithNamePrefix(string namePrefix) { PersistentVariableRepository repository = new PersistentVariableRepository(); return(repository.FetchAllWithNamePrefix(namePrefix)); }
} // SaveToDatabase /// <summary> /// if the name wasn't found, returns a new CmsPersistentVariable object, with the .Name set to String.Empty /// </summary> /// <param name="name"></param> /// <returns></returns> public static CmsPersistentVariable Fetch(string name) { PersistentVariableRepository repository = new PersistentVariableRepository(); return(repository.FetchbyName(name)); } // Fetch