コード例 #1
0
ファイル: RepositoryUser.cs プロジェクト: EnvyIT/apollo
        public async Task <int> DeleteCityAsync(long cityId)
        {
            await ValidateId(_cityDao, cityId);

            if (await _addressDao.IsAnyAddressReferencingCityAsync(cityId))
            {
                var entityReferenceException = new EntityReferenceException(cityId, "City is not deletable");
                Logger.Error(entityReferenceException, "{City} is not deletable", cityId);
                throw entityReferenceException;
            }

            return(await _cityDao.FluentSoftDeleteById(cityId));
        }