public static void ImportJsonFile(string json, IPropertiesService service) { var propertiesDto = JsonSerializer.Deserialize <IEnumerable <PropertyAsJson> >(json); foreach (var prop in propertiesDto) { service.Add(prop.District, prop.Price, prop.Floor, prop.TotalFloors, prop.Size, prop.YardSize, prop.Year, prop.Type, prop.BuildingType); Console.Write("."); } }