From 86c5eb49937db085bba911aeb0b8755992881ccc Mon Sep 17 00:00:00 2001 From: Nadeem Patwekar Date: Thu, 3 Oct 2024 07:06:45 +0530 Subject: [PATCH 1/6] fix: tests for variants entries --- Contentstack.Core.Tests/EntryTest.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Contentstack.Core.Tests/EntryTest.cs b/Contentstack.Core.Tests/EntryTest.cs index e35bcba8..ec578ebd 100644 --- a/Contentstack.Core.Tests/EntryTest.cs +++ b/Contentstack.Core.Tests/EntryTest.cs @@ -98,6 +98,8 @@ await sourceEntry else { Assert.True(result.Uid == sourceEntry.Uid); + Assert.NotNull(result._variant); + Assert.NotNull(result._variant.uid); } }); } @@ -120,6 +122,8 @@ await sourceEntry else { Assert.True(result.Uid == sourceEntry.Uid); + Assert.NotNull(result._variant); + Assert.NotNull(result._variant.uid); } }); } From abebc7b879fd4a0b3132916accdf7319807acdd2 Mon Sep 17 00:00:00 2001 From: Nadeem Patwekar Date: Thu, 3 Oct 2024 07:17:26 +0530 Subject: [PATCH 2/6] chore: add net70 for codeql workflow --- Contentstack.Core.Tests/Contentstack.Core.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj b/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj index 3fc0fee1..0cb855ae 100644 --- a/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj +++ b/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0;net70; false $(Version) From c294f5579e11d49b37056bf251170f81d3f45306 Mon Sep 17 00:00:00 2001 From: Nadeem Patwekar Date: Mon, 7 Oct 2024 16:43:15 +0530 Subject: [PATCH 3/6] fix: fix: github workflow failing fixed --- .../Contentstack.Core.Tests.csproj | 2 +- Contentstack.Core.Tests/EntryTest.cs | 2 +- Contentstack.Core/Models/Entry.cs | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj b/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj index 0cb855ae..e4f7ede4 100644 --- a/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj +++ b/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj @@ -1,7 +1,7 @@  - net8.0;net70; + net8.0;net70; false $(Version) diff --git a/Contentstack.Core.Tests/EntryTest.cs b/Contentstack.Core.Tests/EntryTest.cs index ec578ebd..23124220 100644 --- a/Contentstack.Core.Tests/EntryTest.cs +++ b/Contentstack.Core.Tests/EntryTest.cs @@ -99,7 +99,7 @@ await sourceEntry { Assert.True(result.Uid == sourceEntry.Uid); Assert.NotNull(result._variant); - Assert.NotNull(result._variant.uid); + Assert.NotNull(result._variant["uid"]); } }); } diff --git a/Contentstack.Core/Models/Entry.cs b/Contentstack.Core/Models/Entry.cs index 401a7d75..945a7ea1 100644 --- a/Contentstack.Core/Models/Entry.cs +++ b/Contentstack.Core/Models/Entry.cs @@ -48,7 +48,7 @@ private string _Url internal Dictionary _metadata = new Dictionary(); #endregion - + #region Public Properties /// /// Title of an entry @@ -110,6 +110,22 @@ private string _Url /// public Dictionary Metadata { get; set; } + /// + /// Set key/value attributes of an current entry instance. + /// + /// + /// + /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment"); + /// Entry entry = stack.ContentType("contentType_id").Entry("entry_uid"); + /// entry.Fetch<Product>().ContinueWith((entryResult) => { + /// //Your callback code. + /// //var result = entryResult.Result.Object; + /// }); + /// + /// + public Dictionary _variant { get; set; } + + /// /// Set key/value attributes of an current entry instance. /// From f713bd27ed7077373ad780e12f4dd3aac79b5381 Mon Sep 17 00:00:00 2001 From: Nadeem Patwekar Date: Mon, 7 Oct 2024 16:44:40 +0530 Subject: [PATCH 4/6] fix: github workflow failing fixed --- Contentstack.Core.Tests/EntryTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contentstack.Core.Tests/EntryTest.cs b/Contentstack.Core.Tests/EntryTest.cs index 23124220..fb5d41cf 100644 --- a/Contentstack.Core.Tests/EntryTest.cs +++ b/Contentstack.Core.Tests/EntryTest.cs @@ -123,7 +123,7 @@ await sourceEntry { Assert.True(result.Uid == sourceEntry.Uid); Assert.NotNull(result._variant); - Assert.NotNull(result._variant.uid); + Assert.NotNull(result._variant["uid"]); } }); } From 7479cb6c820694908321de2acaae812bdb496fca Mon Sep 17 00:00:00 2001 From: Nadeem Patwekar Date: Mon, 7 Oct 2024 16:47:32 +0530 Subject: [PATCH 5/6] fix: reverted test proj to use net7.0 --- Contentstack.Core.Tests/Contentstack.Core.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj b/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj index e4f7ede4..3fc0fee1 100644 --- a/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj +++ b/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj @@ -1,7 +1,7 @@  - net8.0;net70; + net7.0 false $(Version) From 42548b27b0c80ed29cf9aa3025055d76d9c5d4bd Mon Sep 17 00:00:00 2001 From: Nadeem Patwekar Date: Mon, 7 Oct 2024 18:31:29 +0530 Subject: [PATCH 6/6] fix: corrected uid to _uid in case of variants --- Contentstack.Core.Tests/EntryTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Contentstack.Core.Tests/EntryTest.cs b/Contentstack.Core.Tests/EntryTest.cs index fb5d41cf..ea9fbd46 100644 --- a/Contentstack.Core.Tests/EntryTest.cs +++ b/Contentstack.Core.Tests/EntryTest.cs @@ -99,7 +99,7 @@ await sourceEntry { Assert.True(result.Uid == sourceEntry.Uid); Assert.NotNull(result._variant); - Assert.NotNull(result._variant["uid"]); + Assert.NotNull(result._variant["_uid"]); } }); } @@ -123,7 +123,7 @@ await sourceEntry { Assert.True(result.Uid == sourceEntry.Uid); Assert.NotNull(result._variant); - Assert.NotNull(result._variant["uid"]); + Assert.NotNull(result._variant["_uid"]); } }); }