Created
December 18, 2025 15:22
-
-
Save karenpayneoregon/0205971644e7da4e5eac1dd0b69f7869 to your computer and use it in GitHub Desktop.
December 17 refactored code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Text.Json; | |
| namespace WorkingWithArrays; | |
| internal class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.WriteLine("Press ENTER to exit"); | |
| Console.ReadLine(); | |
| } | |
| private static void Lesson1() | |
| { | |
| if (!Directory.Exists("Json")) | |
| { | |
| Directory.CreateDirectory("Json"); | |
| } | |
| var decimals = Classes.MockedData.GetDecimals(); | |
| var fileName = Path.Combine("Json", "decimals.json"); | |
| List<decimal> queried1 = decimals.Where(x => x > 50m).ToList(); | |
| Classes.MockedData.WriteDecimalsToJson(fileName, decimals); | |
| var json = JsonSerializer.Serialize(queried1, Classes.MockedData.JsonSerializerOptions); | |
| Console.WriteLine(json); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment