Owneat Technical Guide main Help

Class Personalization

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

[Table("Personalizations")] public sealed class Personalization : Entity, IAuditable

Inheritance

object ← Entity ← Personalization

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

Personalization\(\)

Parameterless constructor.

public Personalization()

Properties

Choices

Choices of the Restaurant.Domain.Aggregates.PersonalizationAggregate.Personalization.

[Required] public List<PersonalizationChoice> Choices { get; set; }

Property Value

List < PersonalizationChoice \>

MaxChoices

Maximum number of choices that can be selected.

public int MaxChoices { get; set; }

Property Value

int

MinChoices

Minimum number of choices that can be selected.

public int MinChoices { get; set; }

Property Value

int

Mode

Mode of the Restaurant.Domain.Aggregates.PersonalizationAggregate.Personalization.

[Required] public PersonalizationMode Mode { get; set; }

Property Value

PersonalizationMode

Name

Name of the Restaurant.Domain.Aggregates.PersonalizationAggregate.Personalization.

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

Property Value

string

Methods

Clone\(\)

Create and return a clone of the Restaurant.Domain.Aggregates.PersonalizationAggregate.Personalization 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 Personalization Clone()

Returns

Personalization

The cloned Restaurant.Domain.Aggregates.PersonalizationAggregate.Personalization

Create\(string, PersonalizationMode, List<PersonalizationChoice\>, int, int\)

public static Personalization Create(string name, PersonalizationMode mode, List<PersonalizationChoice> choices, int minChoices, int maxChoices)

Parameters

name string

mode PersonalizationMode

choices List < PersonalizationChoice \>

minChoices int

maxChoices int

Returns

Personalization

Update\(string, PersonalizationMode, List<PersonalizationChoice\>, int, int\)

Update the Restaurant.Domain.Aggregates.PersonalizationAggregate.Personalization.

public void Update(string name, PersonalizationMode mode, List<PersonalizationChoice> choices, int minChoices, int maxChoices)

Parameters

name string

Name of the Restaurant.Domain.Aggregates.PersonalizationAggregate.Personalization.

mode PersonalizationMode

Mode of the Restaurant.Domain.Aggregates.PersonalizationAggregate.Personalization.

choices List < PersonalizationChoice \>

Choices of the Restaurant.Domain.Aggregates.PersonalizationAggregate.Personalization.

minChoices int

Minimum number of choices that can be selected.

maxChoices int

Maximum number of choices that can be selected.

Last modified: 21 May 2024