From d8f06e1e8be19ffee5231da19ac42a324e330264 Mon Sep 17 00:00:00 2001 From: Stanislav Mykhailenko Date: Thu, 23 Mar 2023 13:56:49 +0200 Subject: [PATCH] Change Lesson 3 Task 1 to fix warnings --- Lesson_3/Task_1/Classes/Cpu.cs | 6 +++--- Lesson_3/Task_1/Classes/Detail.cs | 8 ++++---- Lesson_3/Task_1/Classes/Drive.cs | 6 +++--- Lesson_3/Task_1/Classes/Gpu.cs | 4 ++-- Lesson_3/Task_1/Classes/Motherboard.cs | 18 +++++++++--------- Lesson_3/Task_1/Classes/Ram.cs | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Lesson_3/Task_1/Classes/Cpu.cs b/Lesson_3/Task_1/Classes/Cpu.cs index 10b9505..755433c 100644 --- a/Lesson_3/Task_1/Classes/Cpu.cs +++ b/Lesson_3/Task_1/Classes/Cpu.cs @@ -2,7 +2,7 @@ namespace Classes; class Cpu : Detail { - public string Socket { get; set; } - public int Cores { get; set; } - public int Frequency { get; set; } + public required string Socket { get; set; } + public required int Cores { get; set; } + public required int Frequency { get; set; } } diff --git a/Lesson_3/Task_1/Classes/Detail.cs b/Lesson_3/Task_1/Classes/Detail.cs index 6a5416f..944bab0 100644 --- a/Lesson_3/Task_1/Classes/Detail.cs +++ b/Lesson_3/Task_1/Classes/Detail.cs @@ -2,8 +2,8 @@ namespace Classes; class Detail { - public int Price { get; set; } - public string Supplier { get; set; } - public string Country { get; set; } - public string Name { get; set; } + public required int Price { get; set; } + public required string Supplier { get; set; } + public required string Country { get; set; } + public required string Name { get; set; } } diff --git a/Lesson_3/Task_1/Classes/Drive.cs b/Lesson_3/Task_1/Classes/Drive.cs index eaab24c..c79507c 100644 --- a/Lesson_3/Task_1/Classes/Drive.cs +++ b/Lesson_3/Task_1/Classes/Drive.cs @@ -2,8 +2,8 @@ namespace Classes; class Drive : Detail { - public int Size { get; set; } - public int Speed { get; set; } - public string Interface { get; set; } + public required int Size { get; set; } + public required int Speed { get; set; } + public required string Interface { get; set; } public int? Lifetime { get; set; } } diff --git a/Lesson_3/Task_1/Classes/Gpu.cs b/Lesson_3/Task_1/Classes/Gpu.cs index ec9c3f2..795a136 100644 --- a/Lesson_3/Task_1/Classes/Gpu.cs +++ b/Lesson_3/Task_1/Classes/Gpu.cs @@ -2,6 +2,6 @@ namespace Classes; class Gpu : Detail { - public int Memory { get; set; } - public int Speed { get; set; } + public required int Memory { get; set; } + public required int Speed { get; set; } } diff --git a/Lesson_3/Task_1/Classes/Motherboard.cs b/Lesson_3/Task_1/Classes/Motherboard.cs index 0c7acce..af64061 100644 --- a/Lesson_3/Task_1/Classes/Motherboard.cs +++ b/Lesson_3/Task_1/Classes/Motherboard.cs @@ -2,14 +2,14 @@ namespace Classes; class Motherboard : Detail { - public string RamType { get; set; } - public int RamSlots { get; set; } - public int UsedRamSlots {get; set; } - public string Socket { get; set; } - public int CpuSlots {get; set; } - public int UsedCpuSlots {get; set; } - public int PataSlots { get; set; } + public required string RamType { get; set; } + public required int RamSlots { get; set; } + public int UsedRamSlots { get; set; } + public required string Socket { get; set; } + public required int CpuSlots { get; set; } + public int UsedCpuSlots { get; set; } + public required int PataSlots { get; set; } public int UsedPataSlots {get; set; } - public int SataSlots { get; set; } - public int UsedSataSlots {get; set; } + public required int SataSlots { get; set; } + public int UsedSataSlots { get; set; } } diff --git a/Lesson_3/Task_1/Classes/Ram.cs b/Lesson_3/Task_1/Classes/Ram.cs index 83cd318..7ed7801 100644 --- a/Lesson_3/Task_1/Classes/Ram.cs +++ b/Lesson_3/Task_1/Classes/Ram.cs @@ -2,6 +2,6 @@ namespace Classes; class Ram : Detail { - public string Type { get; set; } - public int Size { get; set; } + public required string Type { get; set; } + public required int Size { get; set; } }