public DefinitionCreateParameters InstantiateTrafficManagerDefinition(Definition definition)
        {
            var definitionCreateParams = new DefinitionCreateParameters();

            var endpoints = new List<DefinitionEndpointCreateParameters>();
            foreach (DefinitionEndpointResponse endpointReponse in definition.Policy.Endpoints)
            {
                var endpoint = new DefinitionEndpointCreateParameters
                    {
                        DomainName = endpointReponse.DomainName,
                        Location = endpointReponse.Location,
                        Type = endpointReponse.Type,
                        Status = endpointReponse.Status,
                        Weight = endpointReponse.Weight
                    };

                endpoints.Add(endpoint);
            }

            definitionCreateParams.Policy = new DefinitionPolicyCreateParameters
            {
                Endpoints = endpoints,
                LoadBalancingMethod = definition.Policy.LoadBalancingMethod
            };

            definitionCreateParams.DnsOptions = definition.DnsOptions;
            definitionCreateParams.Monitors = definition.Monitors;

            return definitionCreateParams;
        }
 public ProfileWithDefinition(Profile profile, Definition definition) : base(profile)
 {
     this.endpoints = null;
     this.definition = definition;
 }
 public ProfileWithDefinition(Management.TrafficManager.Models.Profile profile, Definition definition) : base(profile)
 {
     this.endpoints = null;
     this.definition = definition;
 }