Beispiel #1
0
        /// <summary>
        /// Allows you to build and send custom GraphQL mutation queries to the Storefront API.
        /// </summary>
        /// <param name="buildQuery">delegate that will build a query starting at <see ref="QueryRootQuery">MutationQuery </see></param>
        /// <param name="callback">callback which will receive a response</param>
        /// \code
        /// // Example that creates a new customer on a store
        /// ShopifyBuy.Client().Mutation(
        ///     buildQuery: (mutation) => { mutation
        ///         .customerCreate(
        ///             buildQuery: (cc) => { cc
        ///                 .userErrors(
        ///                     buildQuery: (ue) => { ue
        ///                         .field()
        ///                         .message();
        ///                     }
        ///                 );
        ///             },
        ///             input: new CustomerCreateInput(
        ///                 email: "*****@*****.**",
        ///                 password: "******"
        ///             )
        ///         );
        ///     },
        ///     callback: (data, error) => {
        ///         if (error != null) {
        ///             Debug.Log("There was an error: " + error.Reason);
        ///         } else {
        ///             List<UserError> userErrors = data.customerCreate().userErrors();
        ///
        ///             if (userErrors != null) {
        ///                 foreach(UserError error in userErrors) {
        ///                     // field which may have a user error
        ///                     Debug.Log(error.field());
        ///                     // error message for the field which had an error
        ///                     Debug.Log(error.message());
        ///                 }
        ///             } else {
        ///                 Debug.Log("No user errors the customer was created");
        ///             }
        ///         }
        ///     }
        /// );
        /// \endcode
        public void Mutation(MutationDelegate buildQuery, MutationRootHandler callback)
        {
            MutationQuery query = new MutationQuery();

            buildQuery(query);

            Mutation(query, callback);
        }
 public GeneticAlgorithmFinder(
     FitnessDelegate fitnessDelegate,
     MutationDelegate mutationDelegate,
     CrossOverDelegate crossOverDelegate,
     SelectionDelegate selectionDelegate,
     IRouteService routeService,
     GASettings gASettings
     )
 {
     Fitness           = fitnessDelegate;
     Mutation          = mutationDelegate;
     Crossover         = crossOverDelegate;
     Selection         = selectionDelegate;
     settings          = gASettings;
     this.routeService = routeService;
 }