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 }); }
protected async Task <bool> IsExistCountry(CountryEditDto country) { return((await _countryRepository.CountAsync(c => c.Name == country.Name)) > 0); }