using System; using AyaNova.Biz; using System.ComponentModel.DataAnnotations; namespace AyaNova.Models { /// /// Event log entry /// public partial class Event { public long Id { get; set; } public uint ConcurrencyToken { get; set; } public DateTime Created { get; set; } [Required] public long UserId { get; set; } //----------------------------------------- [Required] public long AyId { get; set; } [Required] public AyaType AyType { get; set; } [Required] public AyaEvent AyEvent { get; set; } [MaxLength(255)] public string Textra { get; set; } public Event() { Created = System.DateTime.UtcNow; } public Event(long userId, long ayId, AyaType ayType, AyaEvent ayEvent, string textra = null) { Created = System.DateTime.UtcNow; UserId = userId; AyId = ayId; AyType = ayType; AyEvent = ayEvent; if (textra != null) { if (textra.Length > 255) textra = textra.Substring(0, 255); Textra = textra; } } public Event(long userId, long ayId, AyaType ayType, AyaEvent ayEvent, DateTime created, string textra = null) { Created = created; UserId = userId; AyId = ayId; AyType = ayType; AyEvent = ayEvent; if (textra != null) { if (textra.Length > 255) textra = textra.Substring(0, 255); Textra = textra; } } }//eoc }//eons