restructure

This commit is contained in:
2025-04-22 22:12:49 +02:00
parent f0a05ca119
commit 9802a4a0e8
27 changed files with 8128 additions and 105 deletions

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QuickDish.Core;
/// <summary>
/// The base recipe class which holds basic tags defining the recipe, a title, a short description and an image and pdf url for the actualy recipe.
/// </summary>
internal class Recipe
{
public string Title { get; set; }
public string Description { get; set; }
public string[] Tags { get; set; }
public string ImageUrl { get; set; }
public string RecipeUrl { get; set; }
public Recipe(string title, string description, string[] tags, string imageUrl, string recipeUrl)
{
if (string.IsNullOrWhiteSpace(title))
throw new ArgumentException("Title can't be empty", nameof(title));
if (string.IsNullOrWhiteSpace(description))
throw new ArgumentException("Description can't be empty", nameof(description));
if (string.IsNullOrWhiteSpace(recipeUrl))
throw new ArgumentException("The Url to the Recipe can't be empty", nameof(recipeUrl));
if (string.IsNullOrWhiteSpace(imageUrl))
throw new ArgumentException("The Url to the Image of the Recipe can't be empty", nameof(imageUrl));
Title = title;
Description = description;
Tags = tags;
ImageUrl = imageUrl;
RecipeUrl = recipeUrl;
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QuickDish.Core;
internal class User
{
public int Id { get; set; }
public string Username { get; set; }
public string PasswordHash { get; set; }
}