Owneat Technical Guide main Help

Class Ingredient

Namespace: Restaurant.Domain.Aggregates.ProductAggregate
Assembly: Restaurant.Domain.dll

public sealed class Ingredient : Entity, IAuditable

Inheritance

object ← Entity ← Ingredient

Implements

IAuditable

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

Ingredient\(\)

public Ingredient()

Properties

Name

Name of the ingredient

[Required] [MaxLength(50)] public string Name { get; set; }

Property Value

string

Product

Restaurant.Domain.Aggregates.ProductAggregate.Ingredient.Product to which is linked the Restaurant.Domain.Aggregates.ProductAggregate.Ingredient.

[InverseProperty("Ingredients")] [JsonIgnore] public Product? Product { get; set; }

Property Value

Product?

Quantity

Quantity value of the ingredient, has to be put before the unit.

[Column(TypeName = "decimal(18,4)")] public decimal Quantity { get; set; }

Property Value

decimal

Unit

Unit of measure of the ingredient composition. i.e (g, kg, l, ml).

[MaxLength(10)] public string Unit { get; set; }

Property Value

string

Methods

Clone\(\)

Create and return a clone of the Restaurant.Domain.Aggregates.ProductAggregate.Ingredient object which call that method. This method clone the values and not the ID, it is made to clone a menu to edit it after.

public Ingredient Clone()

Returns

Ingredient

The cloned Restaurant.Domain.Aggregates.ProductAggregate.Ingredient

Create\(string, string, decimal\)

public static Ingredient Create(string name, string unit, decimal quantity)

Parameters

name string

unit string

quantity decimal

Returns

Ingredient

Last modified: 21 May 2024