Classes |
class | RatingDictionary |
Public Member Functions |
| Recipe (string title) |
| Recipe () |
void | ClearIngredients () |
void | UpdateCategories () |
void | Rate (Person user, double rating) |
| The specified person rates the recipe.
|
void | Save () |
| Saves changes to the recipe.
|
FoodItem | Cook (double servingsMultiplier) |
FoodItem | Cook (double servingsMultiplier, double percentage) |
| Cooks the recipe and returns the resulting FoodItem. asume that all the FoodItems is pressent.
|
void | Delete () |
| Deletes the recipe permanently.
|
override string | ToString () |
Static Public Member Functions |
static List< Recipe > | ListByCriteria (Criteria criteria) |
| Gets a list of recipies filtered by the provided criteria.
|
static Recipe | GetByTitle (string title) |
Properties |
string | Title [get, set] |
| The name of the recipe.
|
internal long | Id [get] |
IDictionary< Ingredient, double > | Ingredients [get, set] |
| List of ingredients included in the recipe and amount in grams.
|
List< string > | Directions [get, set] |
| Cooking directions for the recipe.
|
double | AverageRating [get] |
| The average rating from all votes of the recipe.
|
IDictionary< Person, double > | Ratings [get] |
| Gets a dictionary containing persons, who have rated the recipe, including their respective rating.
|
Difficulty | Difficulty [get, set] |
| The difficulty of the recipe.
|
TimeSpan | PreparationTime [get, set] |
| The amount of time required to cook the recipe.
|
IList< string > | Categories [get, set] |
| The associated categories for the recipe.
|
byte[] | Picture [get, set] |
| A picture of the recipe.
|
double | Servings [get, set] |
| The number of servings produced by the recipe.
|
Private Member Functions |
| Recipe (RecipeRow row) |
| Create a recipe from an underlying row, assumed to be unchanged.
|
void | LoadSteps () |
| Load recipe steps to cachedSteps.
|
void | LoadCachedTags () |
| Load cached tags.
|
Static Private Member Functions |
static internal Recipe | GetById (long recipeId) |
| Loads a single recipe by id.
|
static List< Recipe > | PrioritiseRecipesAfterRating (List< Recipe > recipes, Criteria criteria) |
| Prioritises recipes after their rating. 2.5 stars being middle ground, equalling 0 in priority. Less gains negative influence, more gains positive.
|
static int | GetRatingPriority (double rating) |
| Returns the searchPriority value based on the rating value.
|
static List< Recipe > | PrioritiseRecipesAfterDate (List< Recipe > recipes, Criteria criteria) |
| Prioritises recipe after expiration dates. Recipes requiring ingredients which expiration date is approaching are rated higher then others.
|
static int | GetExpirationDatePriority (DateTime expirationDate) |
| Returns a searchPriority (int) value based on day count til item expires.
|
static List< Recipe > | SortRecipes (List< Recipe > recipes, int index, int length) |
| Sorts the recipe in order after searchPriority. Uses the Quicksort algorithm, found in Introduction to Algorithms by: Thomas H. Cormen, Charles E.Leiserson, Ronald L. Rivest and Clifford Stein.
|
static int | Partition (ref List< Recipe > recipes, int start, int length) |
| Part of the Quicksort algorithm. Rearranges the subarray passed to it.
|
static List< Recipe > | PrioritiseRecipes (List< Recipe > recipes, List< string > keywords) |
| Prioritise recipes after keywords.
|
static List< Recipe > | RemoveIrrelevantRecipes (List< Recipe > recipes, List< string > keywords) |
| Removes any recipes that have no reference to the search keyword.
|
static List< RecipeRow > | GetRecipeByMeal (Criteria criteria) |
| Grabs recipes by meal type, such as Dinner or breakfasts.
|
Private Attributes |
RecipeRow | row |
| Database-related object.
|
bool | modified = true |
| True, if this object have been modified with respect to the database.
|
IDictionary< Ingredient, double > | ingredients = null |
List< string > | directions |
| Steps if loaded.
|
List< RecipeStep > | cachedSteps = null |
| Lazy cached steps.
|
RatingDictionary | ratings = null |
| Lazy loaded ratings dictionary.
|
List< RecipeTag > | cachedTags = null |
| Lazily loaded list of cached tags.
|
IList< string > | tags = null |
| Tags assigned to this Recipe.
|
Picture | picture = null |
| Lazy loaded underlying picture row.
|
bool | pictureModified = false |
| True, if the underlying lazy loaded picture row have been changed with respect to the database.
|
int | searchPriority = 0 |
A recipe.