using System; using System.Collections.Generic; using System.Runtime.CompilerServices; namespace Model { public class Recipe : IEquatable { private static int idCreator = 0; public int Id { get; init; } public string Description { get; init; } public string Title { get; set; } public Recipe(string title, string description = "No Description.") { Id = idCreator++; Title = title; Description = description; } public bool Equals(Recipe? other) { if (other == null) return false; if (other == this) return true; return Title.Equals(other.Title) && Description.Equals(other.Description); } public override int GetHashCode() { return Id.GetHashCode(); } } }