コード例 #1
0
        public async Task <IEnumerable <District> > GetDistrictsAsync(string countryId)
        {
            if (!long.TryParse(countryId, out long id))
            {
                throw new MyAppException
                      {
                          ErrorCode = MyCustomErrorCodes.COUNTRY_ID_UNPARSABLE
                      };
            }

            return(_districtService.GetAllAsync <string>(
                       (p => p.CountryId == id),
                       (p => p.Name),
                       true
                       ));
        }