Skip to content

Commit 813fe72

Browse files
committed
Released 1.2.2.1
1 parent d5804ca commit 813fe72

File tree

5 files changed

+35
-30
lines changed

5 files changed

+35
-30
lines changed

src/BlueWSClient.NET/BlueWSClient.NET.Test/BlueWSClient.NET.Test.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
<WarningLevel>4</WarningLevel>
3434
</PropertyGroup>
3535
<ItemGroup>
36-
<Reference Include="GM.Utility, Version=1.2.4.0, Culture=neutral, PublicKeyToken=a1ae152199607549, processorArchitecture=MSIL">
37-
<HintPath>..\packages\GM.Utility.1.2.4\lib\netstandard2.0\GM.Utility.dll</HintPath>
36+
<Reference Include="GM.Utility, Version=1.2.7.0, Culture=neutral, PublicKeyToken=a1ae152199607549, processorArchitecture=MSIL">
37+
<HintPath>..\packages\GM.Utility.1.2.7\lib\netstandard2.0\GM.Utility.dll</HintPath>
3838
</Reference>
39-
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
40-
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
39+
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
40+
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
4141
</Reference>
4242
<Reference Include="System" />
4343
<Reference Include="System.Core" />

src/BlueWSClient.NET/BlueWSClient.NET.Test/Program.cs

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ namespace BlueWS.Test
1414
class Program
1515
{
1616
// please set your own server address
17-
private const string SERVER_ADDRESS = "http://psis2.mohorko.info/test/";
17+
private const string SERVER_ADDRESS = "https://bluews.mohorko.info/test/";
1818

1919
static void Main(string[] args)
2020
{
21-
WebService webService = new WebService(SERVER_ADDRESS,HttpMethod.GET,false);
21+
var webService = new WebService(SERVER_ADDRESS,HttpMethod.GET,false);
2222

2323
// examples below are testing actions in the BlueWS repository in the /test folder
2424
// you can test your own actions in the same manner
@@ -53,8 +53,8 @@ private static async Task TestAction1(WebService webService)
5353

5454
// the async version
5555
{
56-
Request<JObject> request = new Request<JObject>(webService);
57-
JObject response = await request.CallAsyncTask("TestAction1");
56+
var request = new Request<JObject>(webService);
57+
JObject response = await request.CallAsync("TestAction1");
5858
CheckResult(request, response);
5959
string message = response.Value<string>("Message");
6060
Debug.Assert(message == "Hello world!");
@@ -67,7 +67,7 @@ private static void TestAction2(WebService webService)
6767
Console.WriteLine("Testing Action 2 ...");
6868
Console.WriteLine();
6969

70-
Request<JObject> request = new Request<JObject>(webService);
70+
var request = new Request<JObject>(webService);
7171
JObject response = request.Call();
7272
Debug.Assert(!request.Success);
7373
Debug.Assert(!request.NoNetwork);
@@ -82,7 +82,7 @@ private static void TestAction3(WebService webService)
8282
Console.WriteLine("Testing Action 3 ...");
8383
Console.WriteLine();
8484

85-
Request<JObject> request = new Request<JObject>(webService);
85+
var request = new Request<JObject>(webService);
8686
JObject response = request.Call();
8787
CheckResult(request, response);
8888
string explanation = response.Value<string>("Explanation");
@@ -95,7 +95,7 @@ private static void TestAction4(WebService webService)
9595
Console.WriteLine("Testing Action 4 ...");
9696
Console.WriteLine();
9797

98-
PostLoginRequest<JObject> request = new PostLoginRequest<JObject>(webService);
98+
var request = new PostLoginRequest<JObject>(webService);
9999
JObject response = request.Call();
100100
CheckResult(request, response);
101101
string message = response.Value<string>("Message");
@@ -110,7 +110,7 @@ private static void TestAction5(WebService webService)
110110
Console.WriteLine("Testing Action 5 ...");
111111
Console.WriteLine();
112112

113-
PostLoginRequest<JObject> request = new PostLoginRequest<JObject>(webService);
113+
var request = new PostLoginRequest<JObject>(webService);
114114
JObject response = request.Call();
115115
Debug.Assert(!request.Success);
116116
Debug.Assert(!request.NoNetwork);
@@ -127,7 +127,7 @@ private static void TestAction6(WebService webService)
127127
Console.WriteLine("Testing Action 6 ...");
128128
Console.WriteLine();
129129

130-
PostLoginRequest<JObject> request = new PostLoginRequest<JObject>(webService);
130+
var request = new PostLoginRequest<JObject>(webService);
131131
JObject response = request.Call();
132132
CheckResult(request, response);
133133
string message = response.Value<string>("Message");
@@ -142,7 +142,7 @@ private static void TestAction7(WebService webService)
142142
Console.WriteLine("Testing Action 7 ...");
143143
Console.WriteLine();
144144

145-
Request<JObject> request = new Request<JObject>(webService);
145+
var request = new Request<JObject>(webService);
146146
JObject response = request.Call();
147147
CheckResult(request, response);
148148
int actionParameter = response.Value<int>("ActionParameter");
@@ -156,7 +156,7 @@ private static void TestAction8(WebService webService)
156156
Console.WriteLine();
157157

158158
// sending no data
159-
Request<JObject> request = new Request<JObject>(webService);
159+
var request = new Request<JObject>(webService);
160160
JObject response = request.Call();
161161
CheckResult(request, response);
162162
Debug.Assert(response.Count == 1);
@@ -172,16 +172,22 @@ private static void TestAction8(WebService webService)
172172
request.Parameters.Add("SentInteger",sentInteger);
173173
response = request.Call();
174174
CheckResult(request, response);
175-
int returnedInteger = response.Value<int>("data");
175+
dataProperty = (JProperty)response.AsJEnumerable().Single();
176+
var dataObject = (JObject)dataProperty.Value;
177+
var dataObjectContent = (JProperty)dataObject.AsJEnumerable().Single();
178+
var dataObjectContentValue = (JValue)dataObjectContent.Value;
179+
int returnedInteger = dataObjectContentValue.Value<int>();
176180
Debug.Assert(returnedInteger == sentInteger);
177181

178182
// sending three integers
179183
request = new Request<JObject>(webService);
180-
List<int> sentIntegers = new List<int>(){ 27, 42, 67 };
184+
var sentIntegers = new List<int>(){ 27, 42, 67 };
181185
sentIntegers.ForEach(i => request.Parameters.Add(i.ToString(),i));
182186
response = request.Call();
183187
CheckResult(request, response);
184-
List<int> returnedIntegers = response.Value<JArray>("data").Select(jt => jt.Value<int>()).ToList();
188+
dataProperty = (JProperty)response.AsJEnumerable().Single();
189+
var dataEnumerable=dataProperty.Value.AsJEnumerable();
190+
List<int> returnedIntegers = dataEnumerable.Cast<JProperty>().Select(jp => jp.Value.Value<int>()).ToList();
185191
Debug.Assert(returnedIntegers.SequenceEqual(sentIntegers));
186192
}
187193

@@ -192,7 +198,7 @@ private static async Task TestAction0(WebService webService)
192198
Console.WriteLine();
193199

194200
// the sync version
195-
Request<JObject> request = new Request<JObject>(webService);
201+
var request = new Request<JObject>(webService);
196202
JObject response = request.Call();
197203
Debug.Assert(!request.Success);
198204
Debug.Assert(!request.NoNetwork);
@@ -201,7 +207,7 @@ private static async Task TestAction0(WebService webService)
201207

202208
// the async version
203209
request = new Request<JObject>(webService);
204-
response = await request.CallAsyncTask(nameof(TestAction0));
210+
response = await request.CallAsync(nameof(TestAction0));
205211
Debug.Assert(!request.Success);
206212
Debug.Assert(!request.NoNetwork);
207213
Debug.Assert(request.RawResponse != null);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="GM.Utility" version="1.2.4" targetFramework="net461" />
4-
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net461" />
3+
<package id="GM.Utility" version="1.2.7" targetFramework="net461" />
4+
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net461" />
55
</packages>

src/BlueWSClient.NET/BlueWSClient.NET/BlueWSClient.NET.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<AssemblyName>BlueWS</AssemblyName>
66
<RootNamespace>BlueWS</RootNamespace>
7-
<Version>1.2.2.0</Version>
7+
<Version>1.2.2.1</Version>
88
<Title>BlueWS</Title>
99
<Authors>Grega Mohorko</Authors>
1010
<Company>Grega Mohorko</Company>
@@ -14,9 +14,9 @@
1414
<PackageProjectUrl>https://github.com/GregaMohorko/BlueWSClient.NET</PackageProjectUrl>
1515
<PackageIconUrl>https://raw.githubusercontent.com/GregaMohorko/BlueWS/master/Documentation/Icon/BlueWS.ico</PackageIconUrl>
1616
<PackageTags>EntityFramework Entity Database JSON Criteria Expression TableInheritance ManyToOne OneToMany ManyToMany MySQL</PackageTags>
17-
<PackageReleaseNotes>Added support for actions ending with "Async" phrase (was just "AsyncTask" before).</PackageReleaseNotes>
18-
<AssemblyVersion>1.2.2.0</AssemblyVersion>
19-
<FileVersion>1.2.2.0</FileVersion>
17+
<PackageReleaseNotes>Updated dependencies.</PackageReleaseNotes>
18+
<AssemblyVersion>1.2.2.1</AssemblyVersion>
19+
<FileVersion>1.2.2.1</FileVersion>
2020
<SignAssembly>true</SignAssembly>
2121
<DelaySign>false</DelaySign>
2222
<AssemblyOriginatorKeyFile>GM.StrongNameKey.snk</AssemblyOriginatorKeyFile>
@@ -33,8 +33,8 @@
3333
</PropertyGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="GM.Utility" Version="1.2.4" />
37-
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
36+
<PackageReference Include="GM.Utility" Version="1.2.7" />
37+
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
3838
</ItemGroup>
3939

4040
</Project>

src/BlueWSClient.NET/BlueWSClient.NET/Request.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ public Request(WebService webService)
8282

8383
/// <summary>
8484
/// Calls the associated server with the specified action.
85-
/// <para>If the action is not specified, it will be set to the name of the calling method.</para>
86-
/// <para>You should add the following attribute to the method that is calling this: [MethodImpl(MethodImplOptions.NoInlining)]</para>
85+
/// <para>If the action is not specified, it will be set to the name of the calling method. In that case, you should add the following attribute to the method that is calling this: [MethodImpl(MethodImplOptions.NoInlining)]</para>
8786
/// </summary>
8887
/// <param name="action">The name of the action to call.</param>
8988
[MethodImpl(MethodImplOptions.NoInlining)]

0 commit comments

Comments
 (0)