Exemplo n.º 1
0
        void TagCustomerByConvention(TenantResource customer, TagResource[] allTags)
        {
            var getTag     = new Func <string, TagResource>(name => allTags.Single(t => t.Name == name));
            var sharedTags = allTags.Where(t => t.Name.StartsWith("Shared"));

            customer.WithTag(getTag("External"));
            customer.WithTag(customer.IsVIP() ? getTag("VIP") : customer.IsTrial() ? getTag("Trial") : getTag("Standard"));
            customer.WithTag(customer.IsVIP() ? getTag("Dedicated") : sharedTags.GetRandom());
            customer.WithTag(customer.IsEarlyAdopter() ? getTag("Early adopter") : getTag("Stable"));
            if (customer.IsBetaTester())
            {
                customer.WithTag(getTag("2.x Beta"));
            }
        }