using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Sevomin.Models { public class Ad { [Key] public long Id { get; set; } public string Title { get; set; } public string Description { get; set; } public int Duration { get; set; } public long ClickCount { get; set; } public string Link { get; set; } public DateTime CreatedDate { get; set; } public bool Active { get; set; } [NotMapped] public bool Expired { get { return (CreatedDate.AddDays(Duration) < DateTime.Now); } } } }