| 12345678910111213141516171819202122232425262728293031323334353637 | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
namespace UnivateProperties_API.Model.Campaigns
{
    public class Campaign : BaseEntity
    {
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
        public string Name { get; set; }
        public string Subject { get; set; }
        public string Body { get; set; }
        public string ItemBody { get; set; }
        public int ItemsPerRow { get; set; }
        //public CampaignItem Items { get; set; }
        public bool IsTimeshare { get; set; }        
        [NotMapped]
        public bool IsActive
        {
            get
            {
                if (EndDate.Date >= DateTime.Now.Date)                
                    return true;                
                else
                    return false;
            }
        }
        public virtual ICollection<PropertyCampaignItem> PropertyItems { get; set; }
        public virtual ICollection<CampaignItem> Items { get; set; }
        public virtual ICollection<CampaignPlaceHolder> PlaceHolders { get; set; }
    }
}
 |