add base model classes

pull/34/head
Maxime BATISTA 2 years ago
parent be803872c8
commit 2e487165c9

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class Account
{
private readonly User user;
private readonly string email;
public Account(User user, string email)
{
this.user = user;
this.email = email;
}
public User User { get => user; }
public string Email { get => email; }
}
}

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class Ingredient
{
private readonly string name;
private readonly float amount;
private readonly Quantity quantity;
public Ingredient(string name, float amount, Quantity quantity) {
this.name = name;
this.amount = amount;
this.quantity = quantity;
}
public string Name { get => name; }
public float Amount { get => amount; }
public Quantity Quantity { get => quantity;}
}
}

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class PreparationStep
{
private string name;
private string description;
public PreparationStep(string name, string description)
{
this.name = name;
this.description = description;
}
public string Name { get => name; }
public string Description { get => description; }
}
}

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class Quantity
{
}
}

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class Recipe
{
private string name;
private string description;
private User owner;
private Uri image;
private float averageNote;
private List<Ingredient> ingredients;
private List<PreparationStep> steps;
public Recipe(
string name,
string description,
User owner,
Uri image,
float averageNote,
List<Ingredient> ingredients,
List<PreparationStep> steps)
{
this.name = name;
this.description = description;
this.owner = owner;
this.image = image;
this.averageNote = averageNote;
this.ingredients = ingredients;
this.steps = steps;
}
public string Name { get => name; }
public string Description { get => description; }
public User Owner { get => owner; }
public Uri Image { get => image; }
public float AverageNote { get => averageNote; }
public List<Ingredient> Ingredients { get => ingredients; }
public List<PreparationStep> Steps { get => steps; }
}
}

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class User
{
private string name;
private Uri profilePicture;
public User(Uri profilePicture, string name)
{
this.profilePicture = profilePicture;
this.name = name;
}
public Uri ProfilePicture { get; }
public string Name { get; }
}
}
Loading…
Cancel
Save