47 lines
946 B
C#
47 lines
946 B
C#
using ManagerService.DTOs;
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace ManagerService.Data
|
|
{
|
|
/// <summary>
|
|
/// Translation
|
|
/// </summary>
|
|
public class Translation
|
|
{
|
|
[Key]
|
|
[Required]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
public string Language { get; set; }
|
|
|
|
public string Value { get; set; }
|
|
|
|
|
|
public TranslationDTO ToDTO()
|
|
{
|
|
return new TranslationDTO()
|
|
{
|
|
language = Language,
|
|
value = Value
|
|
};
|
|
}
|
|
|
|
public Translation FromDTO(TranslationDTO translationDTO)
|
|
{
|
|
return new Translation()
|
|
{
|
|
Language = translationDTO.language,
|
|
Value = translationDTO.value
|
|
};
|
|
}
|
|
|
|
public enum TranslationType
|
|
{
|
|
Title,
|
|
Description
|
|
}
|
|
}
|
|
}
|