Files
telegram-bot/modules/RichSiteSummary/Data/Subscriber.cs
T

56 lines
1.4 KiB
C#
Raw Normal View History

2020-03-02 00:00:52 +04:00
/// This file is a part of RSS Bot for Telegram.
/// License: MIT
/// Author: CrazyHackGUT aka Kruzya (Sergey Gut) <kruzefag@gmail.com>
///
using System;
using System.ComponentModel.DataAnnotations;
namespace Kruzya.TelegramBot.RichSiteSummary.Data
{
/// <summary>
/// Represents a subscription in database.
/// </summary>
public class Subscriber
{
/// <summary>
/// The unique Subscription identifier.
/// </summary>
[Key]
public Guid SubscriptionId { get; set; }
/// <summary>
/// The Telegram subscriber id.
/// </summary>
[Required]
public Int64 SubscriberId { get; set; }
/// <summary>
/// Unique feed identifier related with this Subscription. Identifies what user is read.
/// </summary>
public Guid FeedId { get; set; }
/// <summary>
/// Feed related with this Subscription. Identifies what user is read.
/// </summary>
[Required]
public virtual Feed Feed { get; set; }
/// <summary>
/// When user is subscribed on this feed.
/// </summary>
[Required]
public DateTime SubscribedAt { get; set; }
public Subscriber()
{
SubscriptionId = new Guid();
SubscribedAt = DateTime.Now;
}
public Subscriber(Feed feed) : base()
{
Feed = feed;
}
}
}