-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathMatrixOption.cs
More file actions
37 lines (30 loc) · 926 Bytes
/
MatrixOption.cs
File metadata and controls
37 lines (30 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Vote.Monitor.Core.Models;
namespace Vote.Monitor.Domain.Entities.FormBase.Questions;
public record MatrixOption
{
public Guid Id { get; private set; }
public TranslatedString Text { get; private set; }
public bool IsFlagged { get; private set; }
[JsonConstructor]
internal MatrixOption(Guid id, TranslatedString text, bool isFlagged)
{
Id = id;
Text = text;
IsFlagged = isFlagged;
}
public static MatrixOption Create(Guid id,
TranslatedString text, bool isFlagged)
=> new(id, text, isFlagged);
public void AddTranslation(string languageCode)
{
Text.AddTranslation(languageCode);
}
public void RemoveTranslation(string languageCode)
{
Text.RemoveTranslation(languageCode);
}
public void TrimTranslations(IEnumerable<string> languages)
{
Text.TrimTranslations(languages);
}
}