restructure
This commit is contained in:
9
src/QuickDish.Core/QuickDish.Core.csproj
Normal file
9
src/QuickDish.Core/QuickDish.Core.csproj
Normal file
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
38
src/QuickDish.Core/Recipe.cs
Normal file
38
src/QuickDish.Core/Recipe.cs
Normal 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;
|
||||
}
|
||||
}
|
15
src/QuickDish.Core/User.cs
Normal file
15
src/QuickDish.Core/User.cs
Normal 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; }
|
||||
|
||||
}
|
Reference in New Issue
Block a user