Skip to content

Commit b60eccb

Browse files
authored
Merge pull request #58 from contentstack/fix/DX-1484
fix: tests for variants entries
2 parents 0e7b6e2 + 59f9adc commit b60eccb

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Contentstack.Core.Tests/EntryTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ await sourceEntry
9898
else
9999
{
100100
Assert.True(result.Uid == sourceEntry.Uid);
101+
Assert.NotNull(result._variant);
102+
Assert.NotNull(result._variant["_uid"]);
101103
}
102104
});
103105
}
@@ -120,6 +122,8 @@ await sourceEntry
120122
else
121123
{
122124
Assert.True(result.Uid == sourceEntry.Uid);
125+
Assert.NotNull(result._variant);
126+
Assert.NotNull(result._variant["_uid"]);
123127
}
124128
});
125129
}

Contentstack.Core/Models/Entry.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private string _Url
4848

4949
internal Dictionary<string, object> _metadata = new Dictionary<string, object>();
5050
#endregion
51-
51+
5252
#region Public Properties
5353
/// <summary>
5454
/// Title of an entry
@@ -110,6 +110,22 @@ private string _Url
110110
/// </example>
111111
public Dictionary<string, object> Metadata { get; set; }
112112

113+
/// <summary>
114+
/// Set key/value attributes of an current entry instance.
115+
/// </summary>
116+
/// <example>
117+
/// <code>
118+
/// ContentstackClient stack = new ContentstackClinet(&quot;api_key&quot;, &quot;delivery_token&quot;, &quot;environment&quot;);
119+
/// Entry entry = stack.ContentType(&quot;contentType_id&quot;).Entry(&quot;entry_uid&quot;);
120+
/// entry.Fetch&lt;Product&gt;().ContinueWith((entryResult) =&gt; {
121+
/// //Your callback code.
122+
/// //var result = entryResult.Result.Object;
123+
/// });
124+
/// </code>
125+
/// </example>
126+
public Dictionary<string, object> _variant { get; set; }
127+
128+
113129
/// <summary>
114130
/// Set key/value attributes of an current entry instance.
115131
/// </summary>

0 commit comments

Comments
 (0)