-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
49 lines (34 loc) · 1.04 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Console.WriteLine("Hello, World!");
int age = 26;
string name = "Damian";
bool isHere = true;
double salary = 22000.01;
Console.WriteLine($"Hi, {name}. Your age is {age} and is here? {isHere}");
Console.WriteLine($"And you make 💰{salary} a year");
try
{
SavingsAcount myAccount = new SavingsAcount(300);
// myAccount.balance = 300;
Console.Write("Your balance is ");
Console.Write(myAccount.getBalance());
Console.WriteLine(" and you're good looking");
} catch (Exception ex) {
Console.WriteLine($"We got an error: {ex.Message}");
}
*/
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => {
try
{
Console.WriteLine("looking for banks!");
SavingsAcount myAccount = new SavingsAcount("Todd Alberto",300);
return Results.Ok($"Your balance is ${myAccount.getBalance()}");
} catch (Exception ex) {
Console.WriteLine($"We got an error: {ex.Message}");
return Results.Ok(ex.Message);
}
});
app.Run();