Example #1
0
        public async Task <GetCountryForEditOutput> GetCountryForEdit(NullableIdDto input)
        {
            CountryEditDto dto;

            if (input.Id.HasValue)
            {
                dto = (await _countryRepository.GetAsync(input.Id.Value)).MapTo <CountryEditDto>();
            }
            else
            {
                dto = new CountryEditDto();
            }
            return(new GetCountryForEditOutput()
            {
                Country = dto
            });
        }
Example #2
0
 protected async Task <bool> IsExistCountry(CountryEditDto country)
 {
     return((await _countryRepository.CountAsync(c => c.Name == country.Name)) > 0);
 }