public AddCountryDomainEvent(
     string correlationId,
     CountryDomain country)
     : base(correlationId)
 {
     Country = country;
 }
 public UpdateTitleCountryDomainEvent(
     string correlationId,
     CountryDomain country)
     : base(correlationId)
 {
     Country = country;
 }
Esempio n. 3
0
        public async Task <CountryDomain?> Add(
            string correlationToken,
            CountryDomain country,
            CancellationToken token)
        {
            var entityEntry = await _addressesContext
                              .Countries
                              .AddAsync(
                country,
                token);

            return(entityEntry.Entity);
        }
Esempio n. 4
0
        public async Task <bool> Update(
            string correlationToken,
            CountryDomain country,
            CancellationToken token)
        {
            if (!await IsExist(
                    correlationToken,
                    country.Id,
                    token))
            {
                return(false);
            }

            _addressesContext
            .Countries
            .Update(country);

            return(true);
        }
Esempio n. 5
0
        public void InsertDomain(Country country, int index)
        {
            string property = "topLevelDomain";

            if (allCountries[index][property].HasValues)
            {
                country.CountryDomains = new List <CountryDomain>(5);
                int len = allCountries[index][property].Count();

                for (int i = 0; i < len; i++)
                {
                    var domain = new CountryDomain();
                    domain.Domain = GetTopDomain(index, i);
                    if (!string.IsNullOrEmpty(domain.Domain))
                    {
                        country.CountryDomains.Add(domain);
                    }
                }
            }
        }