|
|
|
@ -76,6 +76,30 @@ namespace Model
|
|
|
|
|
public void Export<T>(T obj, string pathToExport)
|
|
|
|
|
where T : class
|
|
|
|
|
=> Serializer.Export<T>(obj, pathToExport);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get all the recipe from the data.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="rcTitle">The title to give for the Recipe Collection</param>
|
|
|
|
|
/// <returns>A RecipeCollection that contain all the recipe in the data.</returns>
|
|
|
|
|
public RecipeCollection GetRecipes(string rcTitle = "default")
|
|
|
|
|
=> new RecipeCollection(rcTitle, Data[nameof(Recipe)].Cast<Recipe>().ToArray());
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get all the Users from the data.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>A list of all Users.</returns>
|
|
|
|
|
public List<User> GetUsers()
|
|
|
|
|
=> new List<User>(Data[nameof(User)].Cast<User>());
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a list of an item in the data.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T">The type of the item</typeparam>
|
|
|
|
|
/// <returns>The list of all the item found in the data.</returns>
|
|
|
|
|
public ICollection<T> GetFromData<T>() where T : class
|
|
|
|
|
=> new List<T>(Data[typeof(T).Name].Cast<T>());
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|