Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

Commit e6f6008

Browse files
committed
Follow MSDN naming conventions
1 parent acfd84c commit e6f6008

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ var client = new ApiClient("test", "username", "password");
1717
Create a new inventory item:
1818

1919
```C#
20-
var inventory_client = new InventoryClient(client);
20+
var inventoryClient = new InventoryClient(client);
2121

2222
var inventory = new Inventory();
2323
inventory.whse = "00";
2424
inventory.partNo = "TESTPART";
2525
inventory.type = InventoryType.Normal;
2626
inventory.status = InventoryStatus.Active;
2727
inventory.description = "Test Inventory";
28-
inventory = inventory_client.Create(inventory);
28+
inventory = inventoryClient.Create(inventory);
2929
```
3030

3131
List inventory matching the query "TEST":
3232

3333
```C#
34-
foreach (var i in inventory_client.List(0, 100, "TEST"))
34+
foreach (var i in inventoryClient.List(0, 100, "TEST"))
3535
{
3636
Console.WriteLine(i.partNo);
3737
}
@@ -40,21 +40,21 @@ foreach (var i in inventory_client.List(0, 100, "TEST"))
4040
Retrieve an inventory item by ID:
4141

4242
```C#
43-
inventory = inventory_client.Fetch(inventory.id);
43+
inventory = inventoryClient.Fetch(inventory.id);
4444
```
4545

4646
Update a field on an existing inventory item:
4747

4848
```C#
4949
inventory.description = "New Description";
50-
inventory_client.Update(inventory.id, inventory);
50+
inventoryClient.Update(inventory.id, inventory);
5151
```
5252

5353
Delete an inventory item (if inventory is in use this will throw an
5454
`ApiException`):
5555

5656
```C#
57-
inventory_client.Delete(inventory.id);
57+
inventoryClient.Delete(inventory.id);
5858
```
5959

6060

api-example-csharp/ApiClient.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ RestClient Client()
7878
{
7979
if (p.Name == "Location")
8080
{
81-
var second_request = new RestRequest();
81+
var secondRequest = new RestRequest();
8282
var location = (string)p.Value;
83-
second_request.Resource = location.Remove(0,
83+
secondRequest.Resource = location.Remove(0,
8484
_client.BaseUrl.ToString().Length);
85-
return Execute<T>(second_request);
85+
return Execute<T>(secondRequest);
8686
}
8787
}
8888
}
@@ -134,8 +134,8 @@ public List<T> List(int start=0, int limit=100, string query=null, object filter
134134

135135
if (filter != null)
136136
{
137-
string json_filter = JsonConvert.SerializeObject(filter);
138-
request.AddQueryParameter("filter", json_filter);
137+
string jsonFilter = JsonConvert.SerializeObject(filter);
138+
request.AddQueryParameter("filter", jsonFilter);
139139
}
140140

141141
request.RequestFormat = DataFormat.Json;

api-example-csharp/Inventory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace ApiTest.InventoryApi
55
{
6-
public class UnitOfMeasure
6+
public class UnitOfMeasure
77
{
88
public int id { get; set; }
99
public string code { get; set; }

api-example-csharp/Program.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,34 @@ public class Program
1111
static int Main(string[] args)
1212
{
1313
var client = new ApiClient("test", "username", "password");
14-
var inventory_client = new InventoryClient(client);
15-
Inventory inventory;
14+
var inventoryClient = new InventoryClient(client);
1615

1716
try
1817
{
1918
// Create inventory
20-
inventory = new Inventory();
19+
var inventory = new Inventory();
2120
inventory.whse = "00";
2221
inventory.partNo = "TESTPART";
2322
inventory.type = InventoryType.Normal;
2423
inventory.status = InventoryStatus.Active;
2524
inventory.description = "Test Inventory";
26-
inventory = inventory_client.Create(inventory);
25+
inventory = inventoryClient.Create(inventory);
2726

2827
// List inventory matching the query "TEST"
29-
foreach (var i in inventory_client.List(0, 100, "TEST"))
28+
foreach (var i in inventoryClient.List(0, 100, "TEST"))
3029
{
3130
// i.id
3231
}
3332

3433
// Get inventory
35-
inventory = inventory_client.Fetch(inventory.id);
34+
inventory = inventoryClient.Fetch(inventory.id);
3635

3736
// Update inventory
3837
inventory.description = "New Description";
39-
inventory_client.Update(inventory.id, inventory);
38+
inventoryClient.Update(inventory.id, inventory);
4039

4140
// Delete inventory
42-
inventory_client.Delete(inventory.id);
41+
inventoryClient.Delete(inventory.id);
4342
}
4443
catch (ApiException e)
4544
{

0 commit comments

Comments
 (0)