private static void ImportTelescopes() { string jsonFile = File.ReadAllText("../../../Resources/telescopes.json"); var telescopes = JsonConvert.DeserializeObject <IEnumerable <TelescopeDto> >(jsonFile); foreach (var telescopeDto in telescopes) { if (telescopeDto.Name == null || telescopeDto.MirrorDiameter == null || telescopeDto.MirrorDiameter <= 0 || telescopeDto.Location == null) { Printer.PrintError(); continue; } QueryMethods.AddTelescope(telescopeDto); } }