Skip to content

Commit f69435d

Browse files
authored
Merge pull request #5 from contentstack/develop
Global fields Support added
2 parents 6812105 + 667f3c3 commit f69435d

14 files changed

Lines changed: 178 additions & 118 deletions

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
### Version: 2.2.0
2+
#### Date: Nov-15-2019
3+
4+
##### Update API:
5+
- Stack
6+
- update function 'GetContentType:'
7+
- ContentType
8+
- update function 'Fetch:'
9+
110
### Version: 2.1.1
211
#### Date: Sept-03-2019
312

Contentstack.AspNetCore/Contentstack.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</Copyright>
1313
<PackageProjectUrl>https://github.com/contentstack/contentstack-dotnet</PackageProjectUrl>
1414
<PackageTags>v1.0.0</PackageTags>
15-
<ReleaseVersion>2.0</ReleaseVersion>
15+
<ReleaseVersion>2.2.0</ReleaseVersion>
1616
</PropertyGroup>
1717

1818
<ItemGroup>

Contentstack.Core.Tests/AssetTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ namespace Contentstack.Core.Tests
1212
{
1313
public class AssetTest
1414
{
15-
string uid = "blt14d101ddeddaeefb";
16-
//string uid = "blt649cfadb08b577db";
15+
string uid = "blt9b96cb4720147bc1";
16+
// string uid = "blt649cfadb08b577db";
1717
ContentstackClient client = StackConfig.GetStack();
1818

1919
[Fact]

Contentstack.Core.Tests/ContentTypeTest.cs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class ContentTypeTest
2020
public async Task FetchContenTypeSchema()
2121
{
2222
ContentType contenttype = client.ContentType(source);
23+
2324
var result = await contenttype.Fetch();
2425
if (result == null)
2526
{
@@ -31,6 +32,23 @@ public async Task FetchContenTypeSchema()
3132
}
3233
}
3334

35+
[Fact]
36+
public async Task FetchContenTypeSchemaIncludeGlobalFields()
37+
{
38+
ContentType contenttype = client.ContentType(source);
39+
var param = new Dictionary<string, object>();
40+
param.Add("include_global_field_schema", true);
41+
var result = await contenttype.Fetch(param);
42+
if (result == null)
43+
{
44+
Assert.False(true, "contenttype.FetchSchema() is not match with expected result.");
45+
}
46+
else
47+
{
48+
Assert.True(true);
49+
}
50+
}
51+
3452
[Fact]
3553
public async Task GetContentTypes()
3654
{
@@ -46,5 +64,24 @@ public async Task GetContentTypes()
4664

4765
}
4866
}
67+
68+
[Fact]
69+
public async Task GetContentTypesIncludeGlobalFields()
70+
{
71+
var param = new Dictionary<string, object>();
72+
param.Add("include_global_field_schema", true);
73+
74+
var result = await client.GetContentTypes(param);
75+
76+
if (result == null)
77+
{
78+
Assert.False(true, "client.getContentTypes is not match with expected result.");
79+
}
80+
else
81+
{
82+
Assert.True(true);
83+
84+
}
85+
}
4986
}
50-
}
87+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netcoreapp2.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
7-
<ReleaseVersion>2.1.0</ReleaseVersion>
7+
<ReleaseVersion>2.2.0</ReleaseVersion>
88
</PropertyGroup>
99

1010
<ItemGroup>

Contentstack.Core.Tests/EntryTest.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ public class EntryTest
1414
ContentstackClient client = StackConfig.GetStack();
1515

1616
////PROD STAG
17-
//String source = "source";
18-
//String singelEntryFetchUID = "blt1f94e478501bba46";
19-
//string htmlSource = "blt2f0dd6a81f7f40e7";
20-
//String referenceFieldUID = "reference";
21-
//EU
2217
String source = "source";
23-
String singelEntryFetchUID = "bltf4268538a14fc5e1";
24-
string htmlSource = "blt7c4197d43c1156ba";
18+
String singelEntryFetchUID = "blt1f94e478501bba46";
19+
string htmlSource = "blt2f0dd6a81f7f40e7";
2520
String referenceFieldUID = "reference";
21+
//EU
22+
//String source = "source";
23+
//String singelEntryFetchUID = "bltf4268538a14fc5e1";
24+
//string htmlSource = "blt7c4197d43c1156ba";
25+
//String referenceFieldUID = "reference";
2626

2727

2828
[Fact]

Contentstack.Core.Tests/Models/SourceModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public class SourceModel
1717
public Boolean Boolean;
1818
public string Date;
1919
public Asset file;
20-
//public List<string> Reference;
21-
//public List<string> Other_reference;
22-
public List<Dictionary<string, object>> Reference;
23-
public List<Dictionary<string, object>> Other_reference;
20+
public List<string> Reference;
21+
public List<string> Other_reference;
22+
// public List<Dictionary<string, object>> Reference;
23+
// public List<Dictionary<string, object>> Other_reference;
2424
public Dictionary<string, object> Group;
2525
public List<Dictionary<string, object>> Modular_blocks;
2626
public object[] Tags;

Contentstack.Core.Tests/Models/SourceModelIncludeRef.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public class SourceModelIncludeRef
1515
public Boolean Boolean;
1616
public string Date;
1717
public List<Entry> Reference;
18-
//public List<string> Other_reference;
19-
public List<Dictionary<string, object>> Other_reference;
18+
public List<string> Other_reference;
19+
// public List<Dictionary<string, object>> Other_reference;
2020
public Dictionary<string, object> Group;
2121
public List<Dictionary<string, object>> Modular_blocks;
2222

Contentstack.Core/Contentstack.Core.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
<PackageId>contentstack.csharp</PackageId>
66
<Authors>Contentstack</Authors>
77
<Description>.NET SDK for the Contentstack Content Delivery API.</Description>
8-
<PackageVersion>2.1.1</PackageVersion>
8+
<PackageVersion>2.2.0</PackageVersion>
99
<Owners>Contentstack</Owners>
1010
<PackageReleaseNotes>Query Find method, Entry Fetch method returns ContentstackCollection of Model.</PackageReleaseNotes>
1111
<Copyright>Copyright © 2012-2019 Contentstack. All Rights Reserved
1212
</Copyright>
1313
<PackOnBuild>true</PackOnBuild>
14-
<PackageTags>v2.1.1</PackageTags>
14+
<PackageTags>v2.2.0</PackageTags>
1515
<PackageProjectUrl>https://github.com/contentstack/contentstack-dotnet</PackageProjectUrl>
1616
<PackageLicenseUrl>https://github.com/contentstack/contentstack-dotnet/blob/master/LICENSE</PackageLicenseUrl>
17-
<ReleaseVersion>2.0</ReleaseVersion>
17+
<ReleaseVersion>2.2.0</ReleaseVersion>
1818
</PropertyGroup>
1919

2020
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Contentstack.Core/ContentstackClient.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using Contentstack.Core.Internals;
44
using Contentstack.Core.Configuration;
@@ -245,11 +245,14 @@ internal Asset Asset()
245245
/// <example>
246246
/// <code>
247247
/// ContentstackClient stack = new ContentstackClinet(&quot;blt5d4sample2633b&quot;, &quot;blt6d0240b5sample254090d&quot;, &quot;stag&quot;);
248-
/// var result = await stack.GetContentTypes();
248+
/// var param = new Dictionary&lt;string, object&gt;();
249+
/// param.Add("include_global_field_schema",true);
250+
/// var result = await stack.GetContentTypes(param);
249251
/// </code>
250252
/// </example>
253+
/// <param name="param">is dictionary of additional parameter</param>
251254
/// <returns>The List of content types schema.</returns>
252-
public async Task<IList> GetContentTypes()
255+
public async Task<IList> GetContentTypes(Dictionary<string, object> param = null)
253256
{
254257
Dictionary<String, Object> headers = GetHeader(_LocalHeaders);
255258
Dictionary<String, object> headerAll = new Dictionary<string, object>();

0 commit comments

Comments
 (0)