You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
709 B

10 years ago
  1. using System;
  2. using System.ComponentModel;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace Sevomin.Models
  6. {
  7. public class Ad
  8. {
  9. [Key]
  10. public long Id { get; set; }
  11. public string Title { get; set; }
  12. public string Description { get; set; }
  13. public int Duration { get; set; }
  14. public long ClickCount { get; set; }
  15. public string Link { get; set; }
  16. public DateTime CreatedDate { get; set; }
  17. public bool Active { get; set; }
  18. [NotMapped]
  19. public bool Expired
  20. {
  21. get { return (CreatedDate.AddDays(Duration) < DateTime.Now); }
  22. }
  23. }
  24. }