Exemple #1
0
        public async Task <District> AddDistrict(InsertDistrictDto input)
        {
            var country = await _countryService.GetByExpression(p => p.Code.Equals(input.CountryCode));

            if (country == null)
            {
                throw new MyAppException
                      {
                          ErrorCode = MyCustomErrorCodes.COUNTRY_NOT_FOUND
                      };
            }

            return(await _districtService.CreateAsync(input, country));
        }