public int CreateCity(BusinessEntities.CityEntity cityEntity) { //using (var scope = new TransactionScope()) // TODO: Handle transction scope. //{ var city = new City { CityName = cityEntity.CityName }; _unitOfWork.CityRepository.Insert(city); _unitOfWork.Save(); //scope.Complete(); return(city.CityId); //} }
public bool UpdateCity(int cityId, BusinessEntities.CityEntity cityEntity) { var success = false; if (cityEntity != null) { //using (var scope = new TransactionScope())// TODO: Handle transction scope. //{ var city = _unitOfWork.CityRepository.GetByID(cityId); if (city != null) { city.CityName = cityEntity.CityName; _unitOfWork.CityRepository.Update(city); _unitOfWork.Save(); //scope.Complete(); success = true; } //} } return(success); }