-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathMatrixRow.cs
More file actions
34 lines (27 loc) · 787 Bytes
/
MatrixRow.cs
File metadata and controls
34 lines (27 loc) · 787 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
using Vote.Monitor.Core.Models;
namespace Vote.Monitor.Domain.Entities.FormBase.Questions;
public record MatrixRow
{
public Guid Id { get; private set; }
public TranslatedString Text { get; private set; }
[JsonConstructor]
internal MatrixRow(Guid id, TranslatedString text)
{
Id = id;
Text = text;
}
public static MatrixRow Create(Guid id, TranslatedString text)
=> new(id, text);
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);
}
}