コード例 #1
0
        public Cities AddCity(Cities city)
        {
            var existingCity = _citiesRepository.GetFirstWhere(x => x.City.ToLower() == city.City.ToLower().Trim());

            if (existingCity != null)
            {
                throw new FlowException("Градот постои!");
            }

            ValidateCity(city);

            _citiesRepository.Add(city);
            _citiesRepository.SaveEntities();

            return(city);
        }