예제 #1
0
        public string serializeJSON(ProductsModel product)
        {
            string jsonString = JsonConvert.SerializeObject(product, new JsonSerializerSettings
            {
                PreserveReferencesHandling = PreserveReferencesHandling.Objects
            });

            return(jsonString);
        }
예제 #2
0
 public static async void SoldProduct(ProductsModel products, int quantity)
 {
     await apiClient.PostAsync("api/Rest/product/SoldProduct?quantitySold=" + quantity, new StringContent(jsonHelper.serializeJSON(products),
                                                                                                          System.Text.Encoding.UTF8, "application/json"));
 }
예제 #3
0
 public static async void insertProducts(ProductsModel product)
 {
     await apiClient.PostAsync("api/Rest/product/InsertOneProductJSON", new StringContent(jsonHelper.serializeJSON(product),
                                                                                          System.Text.Encoding.UTF8, "application/json"));
 }