using gehGassi.Domain.Base;
using gehGassi.Domain.Common;
using gehGassi.Domain.Localization;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace gehGassi.Domain.Pages
{
///
/// Repräsentiert einen FAQ-Eintrag
///
public class Faq : SyncEntityLocalizable, IAuditable
{
///
/// Titel der FAQ
///
[Required]
[MaxLength(100)]
public string Title { get; set; }
///
/// Reihung des FAQ-Eintrags
///
[Required]
public int Order { get; set; }
///
/// FAQ - Frage
///
[Localized]
[NotMapped]
public string Question
{
get => Get("Question", GetLanguage());
set => Set("Question", GetLanguage(), value);
}
///
/// Frage - Inhalt
/// Max-Length / 100 im Viewmodel
///
[Column]
public string QuestionLocalized { get; set; }
///
/// FAQ - Antwort
///
[Localized]
[NotMapped]
public string Answer
{
get => Get("Answer", GetLanguage());
set => Set("Answer", GetLanguage(), value);
}
///
/// FAQ - Antwort
///
[Column]
public string AnswerLocalized { get; set; }
///
/// Online / Offline Status
///
[Required]
public OnlineStatus OnlineStatus { get; set; }
///
/// An wen richtet sich der Eintrag?
///
[Required]
public FaqType Type { get; set; }
///
/// Datum der Erstellung
///
public DateTimeOffset Created { get; set; }
#region IAuditable
///
/// 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.
///
/// Eindeutiger Key
public string AuditKey()
{
return Id.ToString();
}
///
/// Gibt den Objektnamen bzw. die Tabelle der Entität zurück
///
/// Objektnamen
public string AuditTable()
{
return "Faqs";
}
public AuditableOptions Options()
{
return AuditableOptions.Create | AuditableOptions.Edit | AuditableOptions.Delete;
}
#endregion
}
///
/// FAQ mit Namen aufgelöst
///
public class FaqWithNames : SyncEntityVw
{
///
/// Titel der FAQ
///
public string Title { get; set; }
///
/// Reihung des FAQ-Eintrags
///
public int Order { get; set; }
///
/// Frage - Inhalt
///
public string Question{ get; set; }
///
/// Frage - Inhalt
///
public string QuestionLocalized { get; set; }
///
/// Antwort - Inhalt
///
public string Answer { get; set; }
///
/// Antwort - Inhalt
///
public string AnswerLocalized { get; set; }
///
/// Online / Offline Status
///
public OnlineStatus OnlineStatus { get; set; }
///
/// An wen richtet sich der Eintrag?
///
public FaqType Type { get; set; }
///
/// Datum der Erstellung
///
public DateTimeOffset Created { get; set; }
}
}