static async Task Main(string[] args)
{
var input = Console.ReadLine();
List<Country> countries;
try
{
countries = await RESTCountriesAPI.GetCountriesByNameContainsAsync(input);
}
catch (Exception e)
{
Console.WriteLine("Wrong name");
return;
}
countries?.ForEach(country =>
{
Console.WriteLine($"Name: {country.Name}");
Console.WriteLine($"Capital: {country.Capital}");
Console.WriteLine($"Area: {country.Area}");
Console.WriteLine($"Flag: {country.Flag}");
});
}
class Cars
{
private Engine _engine;
public Engine Engine => _engine; //если нужен доступ к Engine из другого класса
public void CreateEngine()
{
_engine = new Engine();
}
}
public static bool isProf(string special)
{
dynamic sl = JObject.Parse(File.ReadAllText(@"..\..\..\..\data\source\specialization.json"));
foreach (var property in sl.specialization)
{
if (property == special)
{
return true;
}
}
return false;
}
public static bool isProf(string special)
{
var sl = JObject.Parse(File.ReadAllText(@"..\..\..\..\data\source\specialization.json"));
return sl.specialization.Any(e => e == special);
}
public class User
{
public int Id { get; set; }
public string Login { get; set; }
public string Password { get; set; }
public virtual UserProfile Profile { get; set; }
}
public class UserProfile
{
public int Id { get; set; }
public string Name { get; set; }
public int Age { get; set; }
[ForeignKey("UserId")]
public virtual User User { get; set; }
}