115 lines
2.9 KiB
C#
115 lines
2.9 KiB
C#
using gehGassi.Domain.Common;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using gehGassi.Domain.Localization;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace gehGassi.Domain.Levels
|
|
{
|
|
/// <summary>
|
|
/// Repräsentiert eine Stufe für einen Dogwalker
|
|
/// </summary>
|
|
public class DogWalkerLevel : LocalizableBase, IAuditable
|
|
{
|
|
/// <summary>
|
|
/// Eindeutige Id
|
|
/// </summary>
|
|
[Key]
|
|
[Required]
|
|
public long Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Stufe
|
|
/// </summary>
|
|
[Required]
|
|
public int Number { get; set; }
|
|
|
|
/// <summary>
|
|
/// Punkte die für diese Stufe benötigt werden
|
|
/// </summary>
|
|
[Required]
|
|
public int ExperiencePoints { get; set; }
|
|
|
|
/// <summary>
|
|
/// Name der Stufe
|
|
/// </summary>
|
|
[Localized]
|
|
[NotMapped]
|
|
public string Name
|
|
{
|
|
get => Get("Name", GetLanguage());
|
|
set => Set("Name", GetLanguage(), value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Name der Stufe - Inhalt
|
|
/// Max-Length / 100 im Viewmodel
|
|
/// </summary>
|
|
[Column]
|
|
public string NameLocalized { get; set; }
|
|
|
|
/// <summary>
|
|
/// Kurzbeschreibung
|
|
/// </summary>
|
|
[Localized]
|
|
[NotMapped]
|
|
public string ShortDescription
|
|
{
|
|
get => Get("ShortDescription", GetLanguage());
|
|
set => Set("ShortDescription", GetLanguage(), value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Kurzbeschreibung
|
|
/// </summary>
|
|
public string ShortDescriptionLocalized { get; set; }
|
|
|
|
/// <summary>
|
|
/// Beschreibung der Stufe HTML
|
|
/// </summary>
|
|
[Localized]
|
|
[NotMapped]
|
|
public string Description
|
|
{
|
|
get => Get("Description", GetLanguage());
|
|
set => Set("Description", GetLanguage(), value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Beschreibung
|
|
/// </summary>
|
|
public string DescriptionLocalized { get; set; }
|
|
|
|
#region IAuditable
|
|
/// <summary>
|
|
/// Gibt den eindeutigen Key für die Entität zurück;
|
|
/// Hier als String gelöst, weil damit auch kombinierte Schlüssel möglich sind.
|
|
/// </summary>
|
|
/// <returns>Eindeutiger Key</returns>
|
|
public string AuditKey()
|
|
{
|
|
return Id.ToString();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt den Objektnamen bzw. die Tabelle der Entität zurück
|
|
/// </summary>
|
|
/// <returns>Objektnamen</returns>
|
|
public string AuditTable()
|
|
{
|
|
return "Levels";
|
|
}
|
|
|
|
public AuditableOptions Options()
|
|
{
|
|
return AuditableOptions.Create | AuditableOptions.Edit | AuditableOptions.Delete;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|