Ejemplo n.º 1
0
        private static ContactRM CreateContactForAssociateWithREST(int associateId, Commands.V1.Contact.Create cmd)
        {
            string url      = CreateContactForAssociateAPI.Replace("{associateId}", associateId.ToString());
            string postREST = PostREST(url, JsonConvert.SerializeObject(cmd));

            return(ReadModels.GetContactRM(postREST));
        }
Ejemplo n.º 2
0
        private static CustomerRM CreateCustomerForAssociateWithREST(Commands.V1.Customer.CreateForAssociate cmd)
        {
            string url      = CreateCustomerForAssociateAPI.Replace("{associateId}", cmd.AssociateId.ToString());
            string postREST = PostREST(url, JsonConvert.SerializeObject(cmd));

            return(ReadModels.GetCustomerRM(postREST));
        }
Ejemplo n.º 3
0
        private static OperatingContextRM CreateOperatingContextForCustomerWithREST(Commands.V1.OperatingContext.CreateForCustomer cmd)
        {
            string url = CreateOperatingContextForCustomerAPI.Replace("{customerId}", cmd.CustomerId.ToString());

            // The associate Id is not really important, but perhaps it should be
            url = url.Replace("{associateId}", "1");

            string postREST = PostREST(url, JsonConvert.SerializeObject(cmd));

            return(ReadModels.GetOperatingContextRM(postREST));
        }
Ejemplo n.º 4
0
        private static AssociateRM CreateAssociateWithREST(Commands.V1.Associate.Create cmd)
        {
            string postREST = PostREST(CreateAssociateAPI, JsonConvert.SerializeObject(cmd));

            return(ReadModels.GetAssociateRM(postREST));
        }