/// <summary> /// Read the yaml file for the specified name /// disregarding the data in the database /// </summary> /// <typeparam name="T"></typeparam> /// <param name="name"></param> /// <returns></returns> public T ReadYaml <T>(string name) { T result = default(T); FileInfo file = GetYamlFile(typeof(T), name); if (file != null) { result = YamlDataDirectory.Load(typeof(T), name).As <T>(); } return(result); }
public override IEnumerable <object> RetrieveAll(Type type) { foreach (object o in DaoRepository.RetrieveAll(type)) { yield return(o); } foreach (object o in YamlDataDirectory.Load(type)) { yield return(o); } }
public override IEnumerable <object> Query(Type type, Func <object, bool> predicate) { foreach (object o in DaoRepository.Query(type, predicate)) { yield return(o); } foreach (object o in YamlDataDirectory.Load(type)) { if (predicate(o)) { yield return(o); } } }
public override IEnumerable <T> Query <T>(Func <T, bool> query) { foreach (T val in DaoRepository.Query(query)) { yield return(val); } foreach (YamlDataFile val in YamlDataDirectory.Load(typeof(T))) { T copy = val.Data.CopyAs <T>(); if (query(copy)) { yield return(copy); } } }