Пример #1
0
        public Task <CloudFlareResult <Zone> > CreateZoneAsync(string name, ZoneType type, Account account, bool?jumpStart)
        {
            var postZone = new PostZone
            {
                Name      = name,
                Account   = account,
                Type      = type,
                JumpStart = jumpStart ?? false
            };

            return(SendRequestAsync <Zone>(_httpClient.PostAsJsonAsync(
                                               $"{ApiParameter.Endpoints.Zone.Base}/", postZone)));
        }
Пример #2
0
        public static void InsertPostZoneAndCountry(ISession session)
        {
            var postZone = new PostZone
            {
                Name           = "United Kingdom",
                Multiplier     = 1,
                AskIfMaxWeight = false,
                Position       = 1,
                IsActive       = true,
                FlatRate       = new Money(10M)
            };

            session.Save(postZone);

            var uk = new Country
            {
                Name     = "United Kingdom",
                Position = 1,
                PostZone = postZone,
                IsActive = true
            };

            session.Save(uk);
        }