well, it's generated column

This commit is contained in:
2024-02-18 19:03:59 +03:00
parent 2ae2d92e26
commit 6a6ed420f1
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -5,6 +5,7 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text; using System.Text;
using Kruzya.TelegramBot.RichSiteSummary.UrchinTrackingModule; using Kruzya.TelegramBot.RichSiteSummary.UrchinTrackingModule;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
@@ -84,10 +85,10 @@ public class Post : RepresentableEntity
public DateTime ReceivedAt { get; set; } public DateTime ReceivedAt { get; set; }
/// <summary> /// <summary>
/// /// SHA256
/// </summary> /// </summary>
[Required]
[MaxLength(64)] [MaxLength(64)]
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
public string UrlHash { get; set; } public string UrlHash { get; set; }
public Post() public Post()
+1 -1
View File
@@ -147,7 +147,7 @@ public class RssFetch : IHostedService, IDisposable
feedPost.Title = post.Title; feedPost.Title = post.Title;
feedPost.Url = post.Link; feedPost.Url = post.Link;
feedPost.PostedAt = post.PublishingDate.GetValueOrDefault(DateTime.Now); feedPost.PostedAt = post.PublishingDate.GetValueOrDefault(DateTime.Now);
feedPost.UrlHash = _hash.GenerateHash(feedPost.Url); // feedPost.UrlHash = _hash.GenerateHash(feedPost.Url);
postsImages.Add(feedPost, await FetchImageUrl(post)); postsImages.Add(feedPost, await FetchImageUrl(post));
newPosts.Add(feedPost); newPosts.Add(feedPost);