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)); }
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)); }
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)); }
private static AssociateRM CreateAssociateWithREST(Commands.V1.Associate.Create cmd) { string postREST = PostREST(CreateAssociateAPI, JsonConvert.SerializeObject(cmd)); return(ReadModels.GetAssociateRM(postREST)); }