Skip to content

Commit 57fb652

Browse files
committed
Updated GM.Utility to 1.1.3.0.
1 parent ffdd855 commit 57fb652

File tree

9 files changed

+38
-171
lines changed

9 files changed

+38
-171
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,39 @@
22
A client library in .NET for [BlueWS](https://github.com/GregaMohorko/BlueWS) library. Includes logic and utility for calling BlueWS web service actions.
33

44
[![Release](https://img.shields.io/github/release/GregaMohorko/BlueWSClient.NET.svg?style=flat-square)](https://github.com/GregaMohorko/BlueWSClient.NET/releases/latest)
5+
[![NuGet](https://img.shields.io/nuget/v/BlueWS.svg?style=flat-square)](https://www.nuget.org/packages/BlueWS)
56

67
## Documentation & Tutorials
78
You can read the documentation and tutorials under the [Wiki](https://github.com/GregaMohorko/BlueWSClient.NET/wiki).
89

910
## Short examples
1011
Creating a web service instance:
1112
```C#
12-
WebService webService = new WebService("https://www.myserver.com/", HttpMethod.Get);
13+
var webService = new WebService("https://www.myserver.com/", HttpMethod.Get);
1314
```
1415

1516
Getting the response for an action *TestAction*:
1617
```C#
17-
Request<JObject> request = new Request<JObject>(webService);
18-
JObject response = request.Call("TestAction");
18+
var request = new Request<JObject>(webService);
19+
JObject response = request.Call();
1920
```
2021

2122
The above example was synchronous and blocked the calling thread.
2223

2324
The asynchronous call looks like this:
2425
```C#
25-
JObject response = await request.CallAsyncTask("TestAction");
26+
JObject response = await request.CallAsyncTask(nameof(TestActionAsyncTask));
2627
```
2728

2829
To send parameters to the server, add them to the ```Parameter``` property of the request before calling:
2930
```C#
30-
request.Parameters.Add(42);
31-
JObject response = request.Call("TestAction");
31+
request.Parameters.Add("TheAnswer",42);
32+
JObject response = request.Call();
3233
```
3334

3435
To get the response in your own type:
3536
```C#
36-
Request<YourClass> request = new Request<YourClass>(webService);
37+
var request = new Request<YourClass>(webService);
3738
YourClass response = request.Call("TestAction");
3839
```
3940

build/BlueWSClient.NET.XML

Lines changed: 0 additions & 142 deletions
This file was deleted.

build/BlueWSClient.NET.dll

-13 KB
Binary file not shown.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ private static async Task TestAction0(WebService webService)
201201

202202
// the async version
203203
request = new Request<JObject>(webService);
204-
response = await request.CallAsyncTask();
204+
response = await request.CallAsyncTask(nameof(TestAction0));
205205
Debug.Assert(!request.Success);
206206
Debug.Assert(!request.NoNetwork);
207207
Debug.Assert(request.RawResponse != null);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@
4040
<AssemblyOriginatorKeyFile>GM.StrongNameKey.snk</AssemblyOriginatorKeyFile>
4141
</PropertyGroup>
4242
<ItemGroup>
43-
<Reference Include="GM.Utility, Version=1.1.2.0, Culture=neutral, PublicKeyToken=a1ae152199607549, processorArchitecture=MSIL">
44-
<HintPath>..\packages\GM.Utility.1.1.2\lib\net461\GM.Utility.dll</HintPath>
43+
<Reference Include="GM.Utility, Version=1.1.3.0, Culture=neutral, PublicKeyToken=a1ae152199607549, processorArchitecture=MSIL">
44+
<HintPath>..\packages\GM.Utility.1.1.3\lib\net461\GM.Utility.dll</HintPath>
45+
<Private>False</Private>
4546
</Reference>
4647
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4748
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
49+
<Private>False</Private>
4850
</Reference>
4951
<Reference Include="System" />
5052
<Reference Include="System.Core" />
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<package >
3+
<metadata>
4+
<id>$id$</id>
5+
<version>$version$</version>
6+
<title>$title$</title>
7+
<authors>$author$</authors>
8+
<owners>$author$</owners>
9+
<licenseUrl>https://github.com/GregaMohorko/BlueWSClient.NET/blob/master/LICENSE</licenseUrl>
10+
<projectUrl>https://github.com/GregaMohorko/BlueWSClient.NET</projectUrl>
11+
<iconUrl>https://raw.githubusercontent.com/GregaMohorko/BlueWS/master/Documentation/Icon/BlueWS.ico</iconUrl>
12+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13+
<description>$description$</description>
14+
<summary>$description$</summary>
15+
<copyright>$copyright$</copyright>
16+
<tags>EntityFramework Entity Database JSON Criteria Expression TableInheritance ManyToOne OneToMany ManyToMany MySQL</tags>
17+
</metadata>
18+
</package>

src/BlueWSClient.NET/BlueWSClient.NET/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ limitations under the License.
2626
// set of attributes. Change these attribute values to modify the information
2727
// associated with an assembly.
2828
[assembly: AssemblyTitle("BlueWS")]
29-
[assembly: AssemblyDescription("A client library for BlueWS library.")]
29+
[assembly: AssemblyDescription("A client library for BlueWS library. Includes logic and utility for calling BlueWS web service actions.")]
3030
[assembly: AssemblyConfiguration("")]
3131
[assembly: AssemblyCompany("Grega Mohorko")]
3232
[assembly: AssemblyProduct("BlueWS")]
@@ -52,5 +52,5 @@ limitations under the License.
5252
// You can specify all the values or you can default the Build and Revision Numbers
5353
// by using the '*' as shown below:
5454
// [assembly: AssemblyVersion("1.0.*")]
55-
[assembly: AssemblyVersion("1.0.0.0")]
56-
[assembly: AssemblyFileVersion("1.0.0.0")]
55+
[assembly: AssemblyVersion("1.2.0.0")]
56+
[assembly: AssemblyFileVersion("1.2.0.0")]

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

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ limitations under the License.
2626
using System.Runtime.CompilerServices;
2727
using System.Text;
2828
using System.Threading.Tasks;
29-
using BlueWS.Net;
3029
using Newtonsoft.Json;
30+
using GM.Utility;
31+
using BlueWS.Net;
3132

3233
namespace BlueWS
3334
{
@@ -79,19 +80,6 @@ public Request(WebService webService)
7980
Parameters = new Dictionary<string, object>();
8081
}
8182

82-
/// <summary>
83-
/// Gets the method that called the current method where this method is used. This does not work when used in async methods.
84-
/// <para>
85-
/// Note that because of compiler optimization, you should add <see cref="MethodImplAttribute"/> to the method where this method is used and use the <see cref="MethodImplOptions.NoInlining"/> value.
86-
/// </para>
87-
/// </summary>
88-
[MethodImpl(MethodImplOptions.NoInlining)]
89-
public static System.Reflection.MethodBase GetCallingMethod()
90-
{
91-
// FIXME GM.Utility
92-
return new System.Diagnostics.StackFrame(2, false)?.GetMethod();
93-
}
94-
9583
/// <summary>
9684
/// Calls the associated server with the specified action.
9785
/// <para>If the action is not specified, it will be set to the name of the calling method.</para>
@@ -101,7 +89,7 @@ public static System.Reflection.MethodBase GetCallingMethod()
10189
public T Call(string action = null)
10290
{
10391
if(action == null) {
104-
action = GetCallingMethod().Name;
92+
action = ReflectionUtility.GetCallingMethod().Name;
10593
}
10694

10795
NameValueCollection data = BeforeCalling(action);
Lines changed: 1 addition & 1 deletion
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.1.2" targetFramework="net461" />
3+
<package id="GM.Utility" version="1.1.3" targetFramework="net461" />
44
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
55
</packages>

0 commit comments

Comments
 (0)