From ca277d844a9fe524e31acb27a3c03d4c80453c8d Mon Sep 17 00:00:00 2001 From: VillSource Date: Sat, 2 Mar 2024 15:59:22 +0700 Subject: [PATCH] feat: add supported programmgin lang --- .../Repositories/DefultArticleRepository.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Src/Infrastructure/Infrastructure/Repositories/DefultArticleRepository.cs b/Src/Infrastructure/Infrastructure/Repositories/DefultArticleRepository.cs index dc32c63..77693fe 100644 --- a/Src/Infrastructure/Infrastructure/Repositories/DefultArticleRepository.cs +++ b/Src/Infrastructure/Infrastructure/Repositories/DefultArticleRepository.cs @@ -39,4 +39,30 @@ public void AddTermOfServiceAndPolicy() var s = _context.Collection() .ReplaceOne(i => i.ID == ID, newPost, options); } + + public void AddSupportedLang() + { + + var ID = new Guid("11111111-1111-4111-9111-111111111111"); + DateTime dt = DateTime.Parse("01/01/2024", new CultureInfo("us")); + + var newPost = new PostCollection() + { + ID = ID, + Title = "Supported Programming Languages", + Content = "{\"time\":1709369598919,\"blocks\":[{\"id\":\"d9E_9CqBZa\",\"type\":\"header\",\"data\":{\"text\":\"Python\",\"level\":2}},{\"id\":\"d0tw_dPNmq\",\"type\":\"codeBlock\",\"data\":{\"language\":\"python\",\"code\":\"print(\\\"Hello, Beta Blog...\\\")\",\"name\":\"Python 13.11.6\"}},{\"id\":\"gNhk5yGj7-\",\"type\":\"header\",\"data\":{\"text\":\"C programming\",\"level\":2}},{\"id\":\"z33tCvJORV\",\"type\":\"codeBlock\",\"data\":{\"language\":\"c\",\"code\":\"#include \\r\\n\\r\\nint main(){\\r\\n printf(\\\"Hello, C World\\\");\\r\\n return 0;\\r\\n}\",\"name\":\"gcc 12.2.1 20220924\"}},{\"id\":\"8l2odZ6aIx\",\"type\":\"header\",\"data\":{\"text\":\"Java\",\"level\":2}},{\"id\":\"D6KDNUFwZa\",\"type\":\"codeBlock\",\"data\":{\"language\":\"java\",\"code\":\"class HelloWorld {\\r\\n public static void main(String[] args) {\\r\\n System.out.println(\\\"Hello, Java World!\\\"); \\r\\n }\\r\\n}\",\"name\":\"microsoft-jdk-17.0.6\"}}],\"version\":\"2.28.2\"}" + ContentPreviews = "", + Cover = "", + IsPublished = true, + Tags = new[] { "BetaBlog", "Languages" }, + AuthorId = "AAAAAAAAAECAAAAAAAAAAA", + LastUpdate = dt, + Timestamp = dt + }; + + var options = new ReplaceOptions { IsUpsert = true }; + var s = _context.Collection() + .ReplaceOne(i => i.ID == ID, newPost, options); + } + }