Skip to content

Commit

Permalink
18 Cache hom task is done and I understand
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdurahmon0412 committed Aug 4, 2023
1 parent b596cb7 commit 1543272
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions N18_1/N18_1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>

</Project>
18 changes: 9 additions & 9 deletions N18_1/OrderManagementService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace N18_1
{
public class OrderManagementService
{
public List<int> Orders { get; set; }
private List<int> Orders = new List<int>();

OrderCacheService Cache = OrderCacheService.GetInstance();

Expand Down Expand Up @@ -79,16 +79,16 @@ public int Sum()

public void Add(int amount)
{
if (amount > 0)
{
//if (amount > 0)
//{
Orders.Add(amount);

}
else
{
throw new Exception("Amount mavjud emas");
// 0 dan validatsa
}
//}
//else
//{
// throw new Exception("Amount mavjud emas");
// // 0 dan validatsa
//}
}
}
}
4 changes: 2 additions & 2 deletions N18_1/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

using N18_1;
using System;

var management = new OrderManagementService();
management.Add(50);
Expand All @@ -14,9 +15,8 @@
Console.WriteLine($"Max{management.Max()}");
Console.WriteLine($"Max{management.Max()}");


management.Add(750);
management.Add(85);
management.Add(12);
management.Add(85);
management.Add(330);

Expand Down

0 comments on commit 1543272

Please sign in to comment.