public class Post : BaseEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
public bool SubscriberOnly { get; set; } = false;
public bool Pinned { get; set; } = false;
public string Description { get; set; } = "";
public int Likes { get; set; } = 0;
public float LocLatitude { get; set; } = 0.0f;
public float LocLongitude { get; set; } = 0.0f;
// Navigation properties
public Guid OwnerId { get; set; }
public User Owner { get; set; }
public Guid CoverId { get; set; }
public UpCover Cover { get; set; }
public ICollection<UpMedia> Media { get; set; }
public ICollection<CommentThread> CommentThreads { get; set; }
public ICollection<User> Tagged { get; set; }
public Post() : base()
{
Media = new HashSet<UpMedia>();
CommentThreads = new HashSet<CommentThread>();
Tagged = new HashSet<User>();
}
public bool HasTaggedLocation()
{
return !(LocLatitude == 0.0f && LocLongitude == 0.0f);
}
}
public class Post : BaseEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
public bool SubscriberOnly { get; set; } = false;
public bool Pinned { get; set; } = false;
public string Description { get; set; } = "";
public int Likes { get; set; } = 0;
public float LocLatitude { get; set; } = 0.0f;
public float LocLongitude { get; set; } = 0.0f;
// Navigation properties
public Guid OwnerId { get; set; }
public User Owner { get; set; }
public Guid CoverId { get; set; }
public UpCover Cover { get; set; }
public ICollection<UpMedia> Media { get; set; }
public ICollection<CommentThread> CommentThreads { get; set; }
public ICollection<User> Tagged { get; set; }
public Post() : base()
{
Media = new HashSet<UpMedia>();
CommentThreads = new HashSet<CommentThread>();
Tagged = new HashSet<User>();
}
public bool HasTaggedLocation()
{
return !(LocLatitude == 0.0f && LocLongitude == 0.0f);
}
}