Class Allergen
Namespace: Restaurant.Domain.Aggregates.ProductAggregate
Assembly: Restaurant.Domain.dll
[Table("Allergens")]
public sealed class Allergen : Entity, IAuditable
Inheritance
object ← Entity ← Allergen
Implements
Inherited Members
Entity.Id, Entity.CreatedAt, Entity.UpdatedAt, Entity.DomainEvents, object.Equals\(object?\), object.Equals\(object?, object?\), object.GetHashCode\(\), object.GetType\(\), object.ReferenceEquals\(object?, object?\), object.ToString\(\)
Constructors
Allergen\(\)
Parameterless constructor.
public Allergen()
Properties
Name
Name of the Allergen.
[Required]
[MaxLength(200)]
public string Name { get; set; }
Property Value
Products
All products where the allergen is present.
[JsonIgnore]
public IEnumerable<Product> Products { get; set; }
Property Value
IEnumerable < Product \>
Methods
Create\(string\)
Method that create an Restaurant.Domain.Aggregates.ProductAggregate.Allergen by passing its name.
public static Allergen Create(string name)
Parameters
name string
Name of the Restaurant.Domain.Aggregates.ProductAggregate.Allergen.
Returns
Allergen
The created Restaurant.Domain.Aggregates.ProductAggregate.Allergen.
Last modified: 21 May 2024