Skip to content

Commit 3e1bc30

Browse files
adding Ordering lite classes
1 parent 3967265 commit 3e1bc30

File tree

16 files changed

+310
-52
lines changed

16 files changed

+310
-52
lines changed

.vscode/launch.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"name": ".NET Core Launch (Catalog)",
10+
"type": "coreclr",
11+
"request": "launch",
12+
"preLaunchTask": "build-catalog",
13+
"program": "${workspaceFolder}/src/Services/Catalog/Catalog.API/bin/Debug/net5.0/Catalog.API.dll",
14+
"args": [],
15+
"cwd": "${workspaceFolder}/src/Services/Catalog/Catalog.API",
16+
"stopAtEntry": false,
17+
"serverReadyAction": {
18+
"action": "openExternally",
19+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
20+
},
21+
"env": {
22+
"ASPNETCORE_ENVIRONMENT": "Development",
23+
"ASPNETCORE_URLS":"http://localhost:6001"
24+
}
25+
},
26+
{
27+
"name": ".NET Core Launch (Basket)",
28+
"type": "coreclr",
29+
"request": "launch",
30+
"preLaunchTask": "build-basket",
31+
"program": "${workspaceFolder}/src/Services/Basket/Basket.API/bin/Debug/net5.0/Basket.API.dll",
32+
"args": [],
33+
"cwd": "${workspaceFolder}/src/Services/Basket/Basket.API",
34+
"stopAtEntry": false,
35+
"serverReadyAction": {
36+
"action": "openExternally",
37+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
38+
},
39+
"env": {
40+
"ASPNETCORE_ENVIRONMENT": "Development",
41+
"ASPNETCORE_URLS":"http://localhost:6002"
42+
}
43+
},
44+
{
45+
"name": ".NET Core Launch (Discount)",
46+
"type": "coreclr",
47+
"request": "launch",
48+
"preLaunchTask": "build-discount",
49+
"program": "${workspaceFolder}/src/Services/Discount/Discount.API/bin/Debug/net5.0/Discount.API.dll",
50+
"args": [],
51+
"cwd": "${workspaceFolder}/src/Services/Discount/Discount.API",
52+
"stopAtEntry": false,
53+
"serverReadyAction": {
54+
"action": "openExternally",
55+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
56+
},
57+
"env": {
58+
"ASPNETCORE_ENVIRONMENT": "Development",
59+
"ASPNETCORE_URLS":"http://localhost:6003"
60+
}
61+
}
62+
63+
64+
]
65+
}

.vscode/tasks.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "build-catalog",
8+
"command": "dotnet",
9+
"type": "shell",
10+
"args": [
11+
"build",
12+
// Ask dotnet build to generate full paths for file names.
13+
"/property:GenerateFullPaths=true",
14+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
15+
"/consoleloggerparameters:NoSummary"
16+
],
17+
"group": "build",
18+
"presentation": {
19+
"reveal": "silent"
20+
},
21+
"problemMatcher": "$msCompile",
22+
"options": {
23+
"cwd": "${workspaceFolder}/src/Services/Catalog/Catalog.API"
24+
}
25+
},
26+
{
27+
"label": "build-basket",
28+
"command": "dotnet",
29+
"type": "shell",
30+
"args": [
31+
"build",
32+
// Ask dotnet build to generate full paths for file names.
33+
"/property:GenerateFullPaths=true",
34+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
35+
"/consoleloggerparameters:NoSummary"
36+
],
37+
"group": "build",
38+
"presentation": {
39+
"reveal": "silent"
40+
},
41+
"problemMatcher": "$msCompile",
42+
"options": {
43+
"cwd": "${workspaceFolder}/src/Services/Basket/Basket.API"
44+
}
45+
},
46+
{
47+
"label": "build-discount",
48+
"command": "dotnet",
49+
"type": "shell",
50+
"args": [
51+
"build",
52+
// Ask dotnet build to generate full paths for file names.
53+
"/property:GenerateFullPaths=true",
54+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
55+
"/consoleloggerparameters:NoSummary"
56+
],
57+
"group": "build",
58+
"presentation": {
59+
"reveal": "silent"
60+
},
61+
"problemMatcher": "$msCompile",
62+
"options": {
63+
"cwd": "${workspaceFolder}/src/Services/Discount/Discount.API"
64+
}
65+
}
66+
]
67+
}

src/.vscode/launch.json

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,76 @@
22
"version": "0.2.0",
33
"configurations": [
44
{
5-
// Use IntelliSense to find out which attributes exist for C# debugging
6-
// Use hover for the description of the existing attributes
7-
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8-
"name": ".NET Core Launch (web)",
5+
"name": ".NET Core Launch (Catalog)",
96
"type": "coreclr",
107
"request": "launch",
11-
"preLaunchTask": "build",
12-
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/WebApps/AspnetRunBasics/bin/Debug/net5.0/AspnetRunBasics.dll",
8+
"preLaunchTask": "build-catalog",
9+
"program": "${workspaceFolder}/src/Services/Catalog/Catalog.API/bin/Debug/net5.0/Catalog.API.dll",
1410
"args": [],
15-
"cwd": "${workspaceFolder}/WebApps/AspnetRunBasics",
11+
"cwd": "${workspaceFolder}/src/Services/Catalog/Catalog.API",
1612
"stopAtEntry": false,
17-
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
1813
"serverReadyAction": {
1914
"action": "openExternally",
2015
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
2116
},
2217
"env": {
23-
"ASPNETCORE_ENVIRONMENT": "Development"
18+
"ASPNETCORE_ENVIRONMENT": "Development",
19+
"ASPNETCORE_URLS":"http://localhost:6001"
20+
}
21+
},
22+
{
23+
"name": ".NET Core Launch (Basket)",
24+
"type": "coreclr",
25+
"request": "launch",
26+
"preLaunchTask": "build-basket",
27+
"program": "${workspaceFolder}/src/Services/Basket/Basket.API/bin/Debug/net5.0/Basket.API.dll",
28+
"args": [],
29+
"cwd": "${workspaceFolder}/src/Services/Basket/Basket.API",
30+
"stopAtEntry": false,
31+
"serverReadyAction": {
32+
"action": "openExternally",
33+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
34+
},
35+
"env": {
36+
"ASPNETCORE_ENVIRONMENT": "Development",
37+
"ASPNETCORE_URLS":"http://localhost:6002"
38+
}
39+
},
40+
{
41+
"name": ".NET Core Launch (Discount)",
42+
"type": "coreclr",
43+
"request": "launch",
44+
"preLaunchTask": "build-discount",
45+
"program": "${workspaceFolder}/src/Services/Discount/Discount.API/bin/Debug/net5.0/Discount.API.dll",
46+
"args": [],
47+
"cwd": "${workspaceFolder}/src/Services/Discount/Discount.API",
48+
"stopAtEntry": false,
49+
"serverReadyAction": {
50+
"action": "openExternally",
51+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
2452
},
25-
"sourceFileMap": {
26-
"/Views": "${workspaceFolder}/Views"
53+
"env": {
54+
"ASPNETCORE_ENVIRONMENT": "Development",
55+
"ASPNETCORE_URLS":"http://localhost:6003"
2756
}
2857
},
2958
{
30-
"name": ".NET Core Attach",
59+
"name": ".NET Core Launch (Ordering.API)",
3160
"type": "coreclr",
32-
"request": "attach"
61+
"request": "launch",
62+
"preLaunchTask": "build-ordering-api",
63+
"program": "${workspaceFolder}/Services/OrderingLite/Ordering.API/bin/Debug/net5.0/OrderingLite.API.dll",
64+
"args": [],
65+
"cwd": "${workspaceFolder}/Services/OrderingLite/Ordering.API",
66+
"stopAtEntry": false,
67+
"serverReadyAction": {
68+
"action": "openExternally",
69+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
70+
},
71+
"env": {
72+
"ASPNETCORE_ENVIRONMENT": "Development",
73+
"ASPNETCORE_URLS":"http://localhost:6004"
74+
}
3375
}
3476
]
3577
}

src/.vscode/tasks.json

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,84 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "build",
5+
"label": "build-catalog",
66
"command": "dotnet",
7-
"type": "process",
7+
"type": "shell",
88
"args": [
99
"build",
10-
"${workspaceFolder}/WebApps/AspnetRunBasics/AspnetRunBasics.csproj",
10+
// Ask dotnet build to generate full paths for file names.
1111
"/property:GenerateFullPaths=true",
12+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
1213
"/consoleloggerparameters:NoSummary"
1314
],
14-
"problemMatcher": "$msCompile"
15+
"group": "build",
16+
"presentation": {
17+
"reveal": "silent"
18+
},
19+
"problemMatcher": "$msCompile",
20+
"options": {
21+
"cwd": "${workspaceFolder}/src/Services/Catalog/Catalog.API"
22+
}
1523
},
1624
{
17-
"label": "publish",
25+
"label": "build-basket",
1826
"command": "dotnet",
19-
"type": "process",
27+
"type": "shell",
2028
"args": [
21-
"publish",
22-
"${workspaceFolder}/WebApps/AspnetRunBasics/AspnetRunBasics.csproj",
29+
"build",
30+
// Ask dotnet build to generate full paths for file names.
31+
"/property:GenerateFullPaths=true",
32+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
33+
"/consoleloggerparameters:NoSummary"
34+
],
35+
"group": "build",
36+
"presentation": {
37+
"reveal": "silent"
38+
},
39+
"problemMatcher": "$msCompile",
40+
"options": {
41+
"cwd": "${workspaceFolder}/src/Services/Basket/Basket.API"
42+
}
43+
},
44+
{
45+
"label": "build-discount",
46+
"command": "dotnet",
47+
"type": "shell",
48+
"args": [
49+
"build",
50+
// Ask dotnet build to generate full paths for file names.
2351
"/property:GenerateFullPaths=true",
52+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
2453
"/consoleloggerparameters:NoSummary"
2554
],
26-
"problemMatcher": "$msCompile"
55+
"group": "build",
56+
"presentation": {
57+
"reveal": "silent"
58+
},
59+
"problemMatcher": "$msCompile",
60+
"options": {
61+
"cwd": "${workspaceFolder}/src/Services/Discount/Discount.API"
62+
}
2763
},
2864
{
29-
"label": "watch",
65+
"label": "build-ordering-api",
3066
"command": "dotnet",
31-
"type": "process",
67+
"type": "shell",
3268
"args": [
33-
"watch",
34-
"run",
35-
"${workspaceFolder}/WebApps/AspnetRunBasics/AspnetRunBasics.csproj",
69+
"build",
70+
// Ask dotnet build to generate full paths for file names.
3671
"/property:GenerateFullPaths=true",
72+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
3773
"/consoleloggerparameters:NoSummary"
3874
],
39-
"problemMatcher": "$msCompile"
75+
"group": "build",
76+
"presentation": {
77+
"reveal": "silent"
78+
},
79+
"problemMatcher": "$msCompile",
80+
"options": {
81+
"cwd": "${workspaceFolder}/Services/OrderingLite/Ordering.API"
82+
}
4083
}
4184
]
4285
}

src/Services/OrderingLite/Ordering.API/Controllers/OrderController.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using System.Threading.Tasks;
1212

1313
using Ordering.Application.Contracts.Services;
14-
using Ordering.API.Entities;
14+
using Ordering.Application.Models;
1515

1616
namespace Ordering.API.Controllers
1717
{
@@ -31,7 +31,7 @@ public OrderController(IOrderService orderService)
3131
[ProducesResponseType(typeof(IEnumerable<OrdersVm>), (int)HttpStatusCode.OK)]
3232
public async Task<ActionResult<IEnumerable<OrdersVm>>> GetOrdersByUserName(string userName)
3333
{
34-
var orders = _orderService.GetOrdersByUserName(userName);
34+
var orders = await _orderService.GetOrdersByUserName(userName);
3535
return Ok(orders);
3636
}
3737

@@ -40,6 +40,7 @@ public async Task<ActionResult<IEnumerable<OrdersVm>>> GetOrdersByUserName(strin
4040
[ProducesResponseType((int)HttpStatusCode.OK)]
4141
public async Task<ActionResult<int>> CheckoutOrder([FromBody] CheckoutOrderCommand command)
4242
{
43+
//var orderEntity = _mapper.Map<Order>(command);
4344
var result = await _orderService.CreateOrder(command);
4445
return Ok(result);
4546
}
@@ -48,7 +49,7 @@ public async Task<ActionResult<int>> CheckoutOrder([FromBody] CheckoutOrderComma
4849
[ProducesResponseType(StatusCodes.Status204NoContent)]
4950
[ProducesResponseType(StatusCodes.Status404NotFound)]
5051
[ProducesDefaultResponseType]
51-
public async Task<ActionResult> UpdateOrder([FromBody] CheckoutOrderCommand command)
52+
public async Task<ActionResult> UpdateOrder([FromBody] UpdateOrderCommand command)
5253
{
5354
await _orderService.UpdateOrder(command);
5455
return NoContent();

0 commit comments

Comments
 (0)