Skip to content

Commit 6ea92cd

Browse files
authored
Session10 - Pre-show (#50)
1 parent 5cd4b58 commit 6ea92cd

File tree

10 files changed

+489
-1
lines changed

10 files changed

+489
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*.user
1010
*.userosscache
1111
*.sln.docstates
12+
*.swp
1213

1314
# User-specific files (MonoDevelop/Xamarin Studio)
1415
*.userprefs
@@ -350,4 +351,4 @@ MigrationBackup/
350351
.ionide/
351352

352353
# ignore Jupyter notebook temp folder
353-
.ipynb_checkpoints/
354+
.ipynb_checkpoints/
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26124.0
5+
MinimumVisualStudioVersion = 15.0.26124.0
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logic", "Logic\Logic.csproj", "{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{C207CC72-59C4-4D09-82AC-9E6EBB844892}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Debug|x64 = Debug|x64
14+
Debug|x86 = Debug|x86
15+
Release|Any CPU = Release|Any CPU
16+
Release|x64 = Release|x64
17+
Release|x86 = Release|x86
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
23+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
25+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|x64.ActiveCfg = Debug|Any CPU
26+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|x64.Build.0 = Debug|Any CPU
27+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|x86.ActiveCfg = Debug|Any CPU
28+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|x86.Build.0 = Debug|Any CPU
29+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
30+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|x64.ActiveCfg = Release|Any CPU
32+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|x64.Build.0 = Release|Any CPU
33+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|x86.ActiveCfg = Release|Any CPU
34+
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|x86.Build.0 = Release|Any CPU
35+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|Any CPU.Build.0 = Debug|Any CPU
37+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|x64.ActiveCfg = Debug|Any CPU
38+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|x64.Build.0 = Debug|Any CPU
39+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|x86.ActiveCfg = Debug|Any CPU
40+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|x86.Build.0 = Debug|Any CPU
41+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|Any CPU.ActiveCfg = Release|Any CPU
42+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|Any CPU.Build.0 = Release|Any CPU
43+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|x64.ActiveCfg = Release|Any CPU
44+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|x64.Build.0 = Release|Any CPU
45+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|x86.ActiveCfg = Release|Any CPU
46+
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|x86.Build.0 = Release|Any CPU
47+
EndGlobalSection
48+
EndGlobal
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Logic
2+
{
3+
public class CouponEvaluator {
4+
5+
public void ApplyCoupon(Order order) {
6+
7+
// Save 10% with the SAVE10 coupon code
8+
if (order.CouponCode == "SAVE10") {
9+
order.CouponSavings = order.TotalCost * 0.1m;
10+
}
11+
12+
}
13+
14+
}
15+
16+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Collections.Generic;
2+
3+
namespace Logic
4+
{
5+
6+
public class Order {
7+
8+
public int OrderId { get; set; }
9+
10+
public string CustomerName { get; set; }
11+
12+
public List<OrderItem> Items { get; set; }
13+
14+
public string CouponCode { get; set; }
15+
16+
public decimal CouponSavings { get; set; } = 0m;
17+
18+
public decimal TotalCost { get; set; }
19+
20+
}
21+
22+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Logic
2+
{
3+
public class OrderItem {
4+
5+
public int OrderId { get; set; }
6+
7+
public int OrderItemId { get; set; }
8+
9+
public Product Product { get; set; }
10+
11+
public int Quantity { get; set; }
12+
13+
public decimal TotalPrice { get; set; }
14+
15+
}
16+
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace Logic
4+
{
5+
public class Product
6+
{
7+
public int ProductId { get; set; }
8+
9+
public string Name { get; set; }
10+
11+
public decimal Price { get; set; }
12+
13+
}
14+
}

0 commit comments

Comments
 (0)