Initial commit
This commit is contained in:
49
MealPlan.Api/Models/Recipe.cs
Normal file
49
MealPlan.Api/Models/Recipe.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace MealPlan.Api.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Maps to the existing "Recipes" table. Database-first; no migrations manage this table.
|
||||
/// </summary>
|
||||
[Table("Recipes")]
|
||||
public class Recipe
|
||||
{
|
||||
[Column("Id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("Name")]
|
||||
[MaxLength(255)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>Stored as INT in the DB (0..3). Mapped to the <see cref="MealCategory"/> enum.</summary>
|
||||
[Column("MealCategory")]
|
||||
public int MealCategory { get; set; }
|
||||
|
||||
[Column("Calories")]
|
||||
public int? Calories { get; set; }
|
||||
|
||||
[Column("Protein")]
|
||||
public decimal? Protein { get; set; }
|
||||
|
||||
[Column("Fat")]
|
||||
public decimal? Fat { get; set; }
|
||||
|
||||
[Column("Carbs")]
|
||||
public decimal? Carbs { get; set; }
|
||||
|
||||
[Column("PrepTimeMinutes")]
|
||||
public int? PrepTimeMinutes { get; set; }
|
||||
|
||||
[Column("CreatedAt")]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
[Column("UpdatedAt")]
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
|
||||
[Column("IsActive")]
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public ICollection<Ingredient> Ingredients { get; set; } = new List<Ingredient>();
|
||||
public ICollection<RecipeStep> Steps { get; set; } = new List<RecipeStep>();
|
||||
}
|
||||
Reference in New Issue
Block a user