Files

55 lines
1.3 KiB
C#
Raw Permalink Normal View History

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