BikeInCity.Services.CityService.NewCity C# (CSharp) Method

NewCity() private method

private NewCity ( string countryName, double lat, double lng, string name ) : City
countryName string
lat double
lng double
name string
return BikeInCity.Model.City
        private City NewCity(string countryName, double lat, double lng, string name)
        {
            var country = _repository.Find<Country>(x => x.Name == countryName).FirstOrDefault();

            if (country == null)
            {
                country = new Country() { Name = countryName };
                _repository.Save<Country>(country);
            }

            City city = new City { Country = country, Lat = lat, Lng = lng, Name = name };
            return city;
        }