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.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Kruzya.TelegramBot.RichSiteSummary.UrchinTrackingModule;
using Telegram.Bot.Types.Enums;
@@ -84,10 +85,10 @@ public class Post : RepresentableEntity
public DateTime ReceivedAt { get; set; }
/// <summary>
///
/// SHA256
/// </summary>
[Required]
[MaxLength(64)]
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
public string UrlHash { get; set; }
public Post()
+1 -1
View File
@@ -147,7 +147,7 @@ public class RssFetch : IHostedService, IDisposable
feedPost.Title = post.Title;
feedPost.Url = post.Link;
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));
newPosts.Add(feedPost);