Skip to content

Commit e0631e7

Browse files
committed
Documentation updated
1 parent fbf2cb4 commit e0631e7

6 files changed

Lines changed: 57 additions & 66 deletions

File tree

Contentstack.AspNetCore/Contentstack.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<ItemGroup>
2424
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.2" />
2525
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="1.1.1" />
26-
<PackageReference Include="contentstack.csharp" Version="1.0.6" />
26+
<PackageReference Include="contentstack.csharp" Version="1.1.0" />
2727
<PackageReference Include="NuGet.Build.Packaging" Version="0.2.0" />
2828
</ItemGroup>
2929
</Project>

Contentstack.Core.Tests/Contentstack.Core.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<Compile Remove="EmptyClass.cs" />
2626
<Compile Remove="appSetings.cs" />
2727
<Compile Remove="TestResults\LocaleTest.cs" />
28+
<Compile Remove="LocalTest.cs" />
2829
</ItemGroup>
2930
<ItemGroup>
3031
<None Remove="stack.config" />

Contentstack.Core/ContentstackClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ internal Asset Asset()
243243
/// <example>
244244
/// <code>
245245
/// ContentstackClient stack = new ContentstackClinet(&quot;blt5d4sample2633b&quot;, &quot;blt6d0240b5sample254090d&quot;, &quot;stag&quot;);
246-
/// ContentType contentType = stack.GetContentTypes();
246+
/// var result = await stack.GetContentTypes();
247247
/// </code>
248248
/// </example>
249249
/// <returns>The List of content types schema.</returns>

Contentstack.Core/Models/Asset.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public object this[string key]
6666
}
6767
}
6868

69+
/// <summary>
70+
/// An absolute URL to this file.
71+
/// </summary>
6972
public string Url
7073
{
7174
get
@@ -82,14 +85,28 @@ public string Url
8285
}
8386
}
8487

85-
public string Uid { get; set; }
88+
/// <summary>
89+
/// This is Entry Uid of an entry.
90+
/// </summary>
91+
public string Uid { get; set; }
92+
93+
/// <summary>
94+
/// The size of the file in bytes.
95+
/// </summary>
8696
[JsonProperty(PropertyName = "file_size")]
8797
public string FileSize { get; set; }
88-
public string FileName { get; set; }
89-
public string Description { get; set; }
98+
99+
/// <summary>
100+
/// The original name of the file.
101+
/// </summary>
102+
public string FileName { get; set; }
103+
104+
public string Description { get; set; }
105+
106+
/// <summary>
107+
/// Set array of Tags
108+
/// </summary>
90109
public Object[] Tags { get; set; }
91-
public int Count { get; set; }
92-
public int TotalCount { get; set; }
93110

94111
#region Internal Constructors
95112
internal Asset(ContentstackClient stack, string uid)

Contentstack.Core/Models/ContentstackCollection.cs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,41 @@
66

77
namespace Contentstack.Core.Models
88
{
9-
[JsonObject]
10-
public class ContentstackCollection<T> : IEnumerable<T>
11-
{
12-
public int skip { get; set; }
9+
[JsonObject]
10+
public class ContentstackCollection<T> : IEnumerable<T>
11+
{
12+
/// <summary>
13+
/// The number of items skipped in this resultset.
14+
/// </summary>
15+
public int Skip { get; set; }
1316

14-
public int limit { get; set; }
17+
/// <summary>
18+
/// The maximum number of items returned in this result.
19+
/// </summary>
20+
public int Limit { get; set; }
1521

22+
/// <summary>
23+
/// The total number of items available.
24+
/// </summary>
1625
public int Count { get; set; }
1726

27+
/// <summary>
28+
/// The System.Collections.Generic.IEnumerable&lt;T&gt; of items to be serialized from the API response.
29+
/// </summary>
30+
/// <value>System.Collections.Generic.IEnumerable&lt;T&gt;</value>
1831
public IEnumerable<T> Items { get; set; }
1932

33+
/// <summary>
34+
/// Returns an enumerator that iterates through the <see cref="Items"/> collection
35+
/// </summary>
2036
public IEnumerator<T> GetEnumerator()
2137
{
2238
return Items.GetEnumerator();
2339
}
2440

41+
/// <summary>
42+
/// Returns an enumerator that iterates through the <see cref="Items"/> collection
43+
/// </summary>
2544
IEnumerator IEnumerable.GetEnumerator()
2645
{
2746
return Items.GetEnumerator();

Contentstack.Core/Models/Query.cs

Lines changed: 8 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,9 +1197,9 @@ public Query Only(String[] fieldUid)
11971197
UrlQueries.Add("only[BASE][]", fieldUid);
11981198
}
11991199
}
1200-
catch
1201-
{
1202-
//CSAppUtils.showLog(TAG, "--include Reference-catch|" + e);
1200+
catch (Exception e)
1201+
{
1202+
Console.WriteLine("IOException source: {0}", e.Source);
12031203
}
12041204

12051205
return this;
@@ -1234,9 +1234,9 @@ public Query Except(String[] fieldUids)
12341234
UrlQueries.Add("except[BASE][]", fieldUids);
12351235
}
12361236
}
1237-
catch
1237+
catch (Exception e)
12381238
{
1239-
//CSAppUtils.showLog(TAG, "--include Reference-catch|" + e);
1239+
Console.WriteLine("IOException source: {0}", e.Source);
12401240
}
12411241
return this;
12421242
}
@@ -1269,52 +1269,6 @@ public Query IncludeSchema()
12691269
throw new Exception(StackConstants.ErrorMessage_QueryFilterException, e);
12701270
}
12711271
return this;
1272-
}
1273-
1274-
1275-
/// <summary>
1276-
/// Include object owner&#39;s profile in the objects data.
1277-
/// </summary>
1278-
/// <returns>Current instance of Query, this will be useful for a chaining calls.</returns>
1279-
/// <example>
1280-
/// <code>
1281-
/// //&quot;blt5d4sample2633b&quot; is a dummy Stack API key
1282-
/// //&quot;blt6d0240b5sample254090d&quot; is dummy access token.
1283-
/// ContentstackClient stack = new ContentstackClinet(&quot;blt5d4sample2633b&quot;, &quot;blt6d0240b5sample254090d&quot;, &quot;stag&quot;);
1284-
/// Query csQuery = stack.ContentType(&quot;contentType_id&quot;).Query();
1285-
///
1286-
/// csQuery.IncludeOwner();
1287-
/// csQuery.Find&lt;Product&gt;().ContinueWith((queryResult) =&gt; {
1288-
/// //Your callback code.
1289-
/// });
1290-
/// </code>
1291-
/// </example>
1292-
private Query IncludeOwner()
1293-
{
1294-
try
1295-
{
1296-
UrlQueries.Add("include_owner", true);
1297-
}
1298-
catch (Exception e)
1299-
{
1300-
throw new Exception(StackConstants.ErrorMessage_QueryFilterException, e);
1301-
}
1302-
return this;
1303-
}
1304-
1305-
1306-
1307-
private Query IncludeDraft()
1308-
{
1309-
try
1310-
{
1311-
UrlQueries.Add("include_draft", true);
1312-
}
1313-
catch (Exception e)
1314-
{
1315-
throw new Exception(StackConstants.ErrorMessage_QueryFilterException, e);
1316-
}
1317-
return this;
13181272
}
13191273

13201274
/// <summary>
@@ -1582,16 +1536,16 @@ public async Task<ContentstackCollection<T>> FindOne<T>()
15821536
#endregion
15831537
private async Task<ContentstackCollection<T>> Exec<T>()
15841538
{
1585-
Dictionary<String, Object> headers = GetHeader(_Headers);
1586-
Dictionary<String, object> headerAll = new Dictionary<string, object>();
1539+
Dictionary<string, Object> headers = GetHeader(_Headers);
1540+
Dictionary<string, object> headerAll = new Dictionary<string, object>();
15871541
Dictionary<string, object> mainJson = new Dictionary<string, object>();
15881542

15891543
//Dictionary<string, object> urlQueries = new Dictionary<string, object>();
15901544
if (headers != null && headers.Count() > 0)
15911545
{
15921546
foreach (var header in headers)
15931547
{
1594-
headerAll.Add(header.Key, (String)header.Value);
1548+
headerAll.Add(header.Key, (string)header.Value);
15951549
}
15961550

15971551
if (headers.ContainsKey("environment"))

0 commit comments

Comments
 (0)