1
votes

Comment convertir la sortie JSON en objets c # et les stocker dans un tableau

J'essaye de désérialiser la sortie JSON en objets .net mais j'obtiens la sortie comme nulle.

J'ai écrit ce code pour récupérer les données JSON et les désérialiser.

  {
    "code": 0,
    "message": "success",
    "items": [
        {
            "item_id": "519558000025988777",
            "name": "0",
            "image_document_id": "",
            "item_name": "0",
            "hsn_or_sac": "",
            "sku": "",
            "image_name": "",
            "status": "active",
            "source": "user",
            "is_linked_with_zohocrm": false,
            "zcrm_product_id": "",
            "description": "",
            "item_tax_preferences": [
                {
                    "tax_specification": "inter",
                    "tax_type": 0,
                    "tax_name": "IGST18",
                    "tax_percentage": 18,
                    "tax_id": "519558000000076071"
                },
                {
                    "tax_specification": "intra",
                    "tax_type": 2,
                    "tax_name": "GST18",
                    "tax_percentage": 18,
                    "tax_id": "519558000000076077"
                }
            ],
            "rate": 1439.84,
            "tax_id": "",
            "reorder_level": "",
            "tax_name": "",
            "tax_percentage": 0,
            "purchase_account_id": "",
            "purchase_account_name": "",
            "account_name": "Sales",
            "unit": "",
            "purchase_description": "",
            "purchase_rate": 0,
            "item_type": "sales",
            "product_type": "goods",
            "is_taxable": true,
            "tax_exemption_id": "",
            "tax_exemption_code": "",
            "has_attachment": false,
            "is_combo_product": false,
            "created_time": "2019-04-25T17:31:13+0530",
            "last_modified_time": "2019-04-25T17:31:13+0530",
            "track_serial_number": false
        },
        {
            "item_id": "519558000005300339",
            "name": "Acer HA270 27\" Full HD IPS White Color Ultra Slim Monitor",
            "image_document_id": "",
            "item_name": "Acer HA270 27\" Full HD IPS White Color Ultra Slim Monitor",
            "hsn_or_sac": "8528",
            "sku": "HA270",
            "image_name": "",
            "status": "active",
            "source": "user",
            "is_linked_with_zohocrm": false,
            "zcrm_product_id": "",
            "description": "",
            "item_tax_preferences": [
                {
                    "tax_specification": "inter",
                    "tax_type": 0,
                    "tax_name": "IGST18",
                    "tax_percentage": 18,
                    "tax_id": "519558000000076071"
                },
                {
                    "tax_specification": "intra",
                    "tax_type": 2,
                    "tax_name": "GST18",
                    "tax_percentage": 18,
                    "tax_id": "519558000000076077"
                }
            ],
            "rate": 16999,
            "tax_id": "",
            "reorder_level": "",
            "tax_name": "",
            "tax_percentage": 0,
            "purchase_account_id": "519558000000043003",
            "purchase_account_name": "Cost of Goods Sold",
            "account_name": "Sales",
            "unit": "Unit",
            "purchase_description": "",
            "purchase_rate": 11300,
            "item_type": "inventory",
            "product_type": "goods",
            "is_taxable": true,
            "tax_exemption_id": "",
            "tax_exemption_code": "",
            "stock_on_hand": -1,
            "has_attachment": false,
            "is_combo_product": false,
            "cf_category": "Monitor",
            "cf_maximum_retail_price_mrp": "18500",
            "created_time": "2019-02-13T18:08:37+0530",
            "last_modified_time": "2019-04-28T16:16:11+0530",
            "track_serial_number": false
        },
        {
            "item_id": "519558000001595908",
            "name": "Acer KA240H bd 24-inch Full HD (1920 x 1080) Display (VGA, DVI Ports)",
            "image_document_id": "",
            "item_name": "Acer KA240H bd 24-inch Full HD (1920 x 1080) Display (VGA, DVI Ports)",
            "hsn_or_sac": "8528",
            "sku": "KA240H",
            "image_name": "",
            "status": "active",
            "source": "user",
            "is_linked_with_zohocrm": false,
            "zcrm_product_id": "",
            "description": "",
            "item_tax_preferences": [
                {
                    "tax_specification": "inter",
                    "tax_type": 0,
                    "tax_name": "IGST18",
                    "tax_percentage": 18,
                    "tax_id": "519558000000076071"
                },
                {
                    "tax_specification": "intra",
                    "tax_type": 2,
                    "tax_name": "GST18",
                    "tax_percentage": 18,
                    "tax_id": "519558000000076077"
                }
            ],
            "rate": 9000,
            "tax_id": "",
            "reorder_level": "",
            "tax_name": "",
            "tax_percentage": 0,
            "purchase_account_id": "519558000000043003",
            "purchase_account_name": "Cost of Goods Sold",
            "account_name": "Sales",
            "unit": "Unit",
            "purchase_description": "",
            "purchase_rate": 6600,
            "item_type": "inventory",
            "product_type": "goods",
            "is_taxable": true,
            "tax_exemption_id": "",
            "tax_exemption_code": "",
            "stock_on_hand": 2,
            "has_attachment": false,
            "is_combo_product": false,
            "cf_category": "Monitor",
            "cf_maximum_retail_price_mrp": "0",
            "created_time": "2018-08-31T12:53:35+0530",
            "last_modified_time": "2018-12-13T21:01:59+0530",
            "track_serial_number": false
        },
        {
            "item_id": "519558000005612779",
            "name": "ADATA XPG GAMMIX D10 8GB DDR4 RAM 2666MHz for Desktop RAM",
            "image_document_id": "",
            "item_name": "ADATA XPG GAMMIX D10 8GB DDR4 RAM 2666MHz for Desktop RAM",
            "hsn_or_sac": "8473",
            "sku": "AX4U266638G16-SRG",
            "image_name": "",
            "status": "active",
            "source": "user",
            "is_linked_with_zohocrm": false,
            "zcrm_product_id": "",
            "description": "",
            "item_tax_preferences": [
                {
                    "tax_specification": "inter",
                    "tax_type": 0,
                    "tax_name": "IGST18",
                    "tax_percentage": 18,
                    "tax_id": "519558000000076071"
                },
                {
                    "tax_specification": "intra",
                    "tax_type": 2,
                    "tax_name": "GST18",
                    "tax_percentage": 18,
                    "tax_id": "519558000000076077"
                }
            ],
            "rate": 4999,
            "tax_id": "",
            "reorder_level": "",
            "tax_name": "",
            "tax_percentage": 0,
            "purchase_account_id": "519558000000043003",
            "purchase_account_name": "Cost of Goods Sold",
            "account_name": "Sales",
            "unit": "Unit",
            "purchase_description": "",
            "purchase_rate": 3100,
            "item_type": "inventory",
            "product_type": "goods",
            "is_taxable": true,
            "tax_exemption_id": "",
            "tax_exemption_code": "",
            "stock_on_hand": 2,
            "has_attachment": false,
            "is_combo_product": false,
            "cf_category": "RAM",
            "cf_maximum_retail_price_mrp": "14999",
            "created_time": "2019-03-01T18:06:05+0530",
            "last_modified_time": "2019-04-27T17:08:53+0530",
            "track_serial_number": false
        }
    ],
    "page_context": {
        "page": 1,
        "per_page": 200,
        "has_more_page": true,
        "report_name": "Items",
        "applied_filter": "Status.All",
        "custom_fields": [],
        "sort_column": "name",
        "sort_order": "A"
    }
}

Voici la sortie JSON qui doit être désérialisée.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
using Newtonsoft.Json;
namespace ConsoleApp1
{
    public enum httpverb
    {
        GET,
        POST,
        PUT,
        DELETE
    }
    public class Item
    {
        public string item_id { get; set; }
        public string name { get; set; }
        public string item_name { get; set; }
        public string hsn_or_sac { get; set; }
        public string sku { get; set; }
        public string image_name { get; set; }
        public string status { get; set; }
        public string source { get; set; }
        public string description { get; set; }       
        public string cf_category { get; set; }
        public string cf_maximum_retail_price_mrp { get; set; }
        public DateTime created_time { get; set; }
        public DateTime last_modified_time { get; set; }
        public bool track_serial_number { get; set; }
    }
    class APIs
    {
         xxxxxcode goes here to fetch JSON from API and store into variable strResponseValue
         string Jsoncontent = strResponseValue;   //Jsoncontent holds json data
         Item books = JsonConvert.DeserializeObject<Item>(Jsoncontent);
         //how to access each object.
}
}

La sortie du JSON fourni doit être désérialisée en objets C # et stockée dans le tableau.


3 commentaires

Copiez et collez votre texte JSON sur app.quicktype.io et il créerait le code C # pour vous.


Voici votre code C #: app.quicktype.io?share=RYdg5eAoI2JbmNfokPeK


Frère c'est très déroutant


4 Réponses :


2
votes

Vous devez fournir une classe RootObject qui a une propriété pour le code, le message et les éléments.

Vous désérialisez ensuite l'objet racine et accédez au tableau d'éléments.


1 commentaires

n'a pas compris mon frère. Je suis nouveau dans ce domaine.



1
votes

Votre modèle sera comme celui-ci, essayez-le

public class ItemTaxPreference
{
    public string tax_specification { get; set; }
    public int tax_type { get; set; }
    public string tax_name { get; set; }
    public int tax_percentage { get; set; }
    public string tax_id { get; set; }
}

public class Item
{
    public string item_id { get; set; }
    public string name { get; set; }
    public string image_document_id { get; set; }
    public string item_name { get; set; }
    public string hsn_or_sac { get; set; }
    public string sku { get; set; }
    public string image_name { get; set; }
    public string status { get; set; }
    public string source { get; set; }
    public bool is_linked_with_zohocrm { get; set; }
    public string zcrm_product_id { get; set; }
    public string description { get; set; }
    public List<ItemTaxPreference> item_tax_preferences { get; set; }
    public double rate { get; set; }
    public string tax_id { get; set; }
    public string reorder_level { get; set; }
    public string tax_name { get; set; }
    public int tax_percentage { get; set; }
    public string purchase_account_id { get; set; }
    public string purchase_account_name { get; set; }
    public string account_name { get; set; }
    public string unit { get; set; }
    public string purchase_description { get; set; }
    public int purchase_rate { get; set; }
    public string item_type { get; set; }
    public string product_type { get; set; }
    public bool is_taxable { get; set; }
    public string tax_exemption_id { get; set; }
    public string tax_exemption_code { get; set; }
    public bool has_attachment { get; set; }
    public bool is_combo_product { get; set; }
    public DateTime created_time { get; set; }
    public DateTime last_modified_time { get; set; }
    public bool track_serial_number { get; set; }
    public int? stock_on_hand { get; set; }
    public string cf_category { get; set; }
    public string cf_maximum_retail_price_mrp { get; set; }
}

public class PageContext
{
    public int page { get; set; }
    public int per_page { get; set; }
    public bool has_more_page { get; set; }
    public string report_name { get; set; }
    public string applied_filter { get; set; }
    public List<object> custom_fields { get; set; }
    public string sort_column { get; set; }
    public string sort_order { get; set; }
}

public class RootObject
{
    public int code { get; set; }
    public string message { get; set; }
    public List<Item> items { get; set; }
    public PageContext page_context { get; set; }
}


0 commentaires

3
votes

Vous devez ajouter cette classe racine dans votre code:

var inputObj = JsonConvert.DeserializeObject<Root>(json);

Ensuite, dans votre classe Item déjà existante, vous ajoutez ou supprimez les propriétés souhaitées. Par exemple, dans le JSON d'entrée, il y a plus de propriétés que dans votre classe, si vous avez besoin de plus, ajoutez-les simplement dans votre classe Item. J'ai utilisé la classe que vous avez fournie.

Ensuite, vous faites ceci:

    public class Root
    {
        public string code { get; set; }
        public string message { get; set; }
        public Item[] items { get; set; }
    }
  • vous avez besoin du package NuGet suivant: Newtonsoft.Json

  • json dans le code ci-dessus est une variable de chaîne contenant le JSON entier, fourni par vous. Veuillez noter que dans votre json fourni, il manque un "}" à la fin.

inputObj est un objet de type Classe racine et contient un tableau de tous les éléments. Par exemple, inputObj.items

 entrez la description de l'image ici

Si vous avez besoin de plus d'aide, commentez ci-dessous.

Cheers


2 commentaires

Frère Merci pour cette merveilleuse solution. mais comment les stocker dans un tableau Je suis totalement nouveau dans ces concepts.


@Abdul À ce stade, il peut être judicieux de simplifier votre question lorsque vous interrogez google. Vous voulez faire 2 choses. Désérialisation de Json vers C #, puis vous voulez que ces éléments se retrouvent dans un tableau. Plus précisément, vous souhaitez probablement lire le processus de désérialisation. newtonsoft.com/json/help/html/SerializingJSON.htm est un guide assez connu. Je chercherais là-dedans, et je lisais simplement sur c # en général.



1
votes

Il n'a pas été désérialisé parce que vous n'avez pas ajouté correctement un objet de niveau racine.

J'ai modélisé votre réponse JSON et ai fait en sorte que POCO (s) la modélise avec les propriétés publiques appropriées pascal casées comme suit: p>

public static class Program
{
    private static void Main(string[] args)
    {
        string data = @"
        {
                'code': 0,
                'message': 'success',
                'items': [
                    {
                        'item_id': '519558000025988777',
                        'name': '0',
                        'image_document_id': '',
                        'item_name': '0',
                        'hsn_or_sac': '',
                        'sku': '',
                        'image_name': '',
                        'status': 'active',
                        'source': 'user',
                        'is_linked_with_zohocrm': false,
                        'zcrm_product_id': '',
                        'description': '',
                        'item_tax_preferences': [
                            {
                                'tax_specification': 'inter',
                                'tax_type': 0,
                                'tax_name': 'IGST18',
                                'tax_percentage': 18,
                                'tax_id': '519558000000076071'
                            },
                            {
                                'tax_specification': 'intra',
                                'tax_type': 2,
                                'tax_name': 'GST18',
                                'tax_percentage': 18,
                                'tax_id': '519558000000076077'
                            }
                        ],
                        'rate': 1439.84,
                        'tax_id': '',
                        'reorder_level': '',
                        'tax_name': '',
                        'tax_percentage': 0,
                        'purchase_account_id': '',
                        'purchase_account_name': '',
                        'account_name': 'Sales',
                        'unit': '',
                        'purchase_description': '',
                        'purchase_rate': 0,
                        'item_type': 'sales',
                        'product_type': 'goods',
                        'is_taxable': true,
                        'tax_exemption_id': '',
                        'tax_exemption_code': '',
                        'has_attachment': false,
                        'is_combo_product': false,
                        'created_time': '2019-04-25T17:31:13+0530',
                        'last_modified_time': '2019-04-25T17:31:13+0530',
                        'track_serial_number': false
                    },
                    {
                        'item_id': '519558000005300339',
                        'name': 'Acer HA270 27\' Full HD IPS White Color Ultra Slim Monitor',
                        'image_document_id': '',
                        'item_name': 'Acer HA270 27\' Full HD IPS White Color Ultra Slim Monitor',
                        'hsn_or_sac': '8528',
                        'sku': 'HA270',
                        'image_name': '',
                        'status': 'active',
                        'source': 'user',
                        'is_linked_with_zohocrm': false,
                        'zcrm_product_id': '',
                        'description': '',
                        'item_tax_preferences': [
                            {
                                'tax_specification': 'inter',
                                'tax_type': 0,
                                'tax_name': 'IGST18',
                                'tax_percentage': 18,
                                'tax_id': '519558000000076071'
                            },
                            {
                                'tax_specification': 'intra',
                                'tax_type': 2,
                                'tax_name': 'GST18',
                                'tax_percentage': 18,
                                'tax_id': '519558000000076077'
                            }
                        ],
                        'rate': 16999,
                        'tax_id': '',
                        'reorder_level': '',
                        'tax_name': '',
                        'tax_percentage': 0,
                        'purchase_account_id': '519558000000043003',
                        'purchase_account_name': 'Cost of Goods Sold',
                        'account_name': 'Sales',
                        'unit': 'Unit',
                        'purchase_description': '',
                        'purchase_rate': 11300,
                        'item_type': 'inventory',
                        'product_type': 'goods',
                        'is_taxable': true,
                        'tax_exemption_id': '',
                        'tax_exemption_code': '',
                        'stock_on_hand': -1,
                        'has_attachment': false,
                        'is_combo_product': false,
                        'cf_category': 'Monitor',
                        'cf_maximum_retail_price_mrp': '18500',
                        'created_time': '2019-02-13T18:08:37+0530',
                        'last_modified_time': '2019-04-28T16:16:11+0530',
                        'track_serial_number': false
                    },
                    {
                        'item_id': '519558000001595908',
                        'name': 'Acer KA240H bd 24-inch Full HD (1920 x 1080) Display (VGA, DVI Ports)',
                        'image_document_id': '',
                        'item_name': 'Acer KA240H bd 24-inch Full HD (1920 x 1080) Display (VGA, DVI Ports)',
                        'hsn_or_sac': '8528',
                        'sku': 'KA240H',
                        'image_name': '',
                        'status': 'active',
                        'source': 'user',
                        'is_linked_with_zohocrm': false,
                        'zcrm_product_id': '',
                        'description': '',
                        'item_tax_preferences': [
                            {
                                'tax_specification': 'inter',
                                'tax_type': 0,
                                'tax_name': 'IGST18',
                                'tax_percentage': 18,
                                'tax_id': '519558000000076071'
                            },
                            {
                                'tax_specification': 'intra',
                                'tax_type': 2,
                                'tax_name': 'GST18',
                                'tax_percentage': 18,
                                'tax_id': '519558000000076077'
                            }
                        ],
                        'rate': 9000,
                        'tax_id': '',
                        'reorder_level': '',
                        'tax_name': '',
                        'tax_percentage': 0,
                        'purchase_account_id': '519558000000043003',
                        'purchase_account_name': 'Cost of Goods Sold',
                        'account_name': 'Sales',
                        'unit': 'Unit',
                        'purchase_description': '',
                        'purchase_rate': 6600,
                        'item_type': 'inventory',
                        'product_type': 'goods',
                        'is_taxable': true,
                        'tax_exemption_id': '',
                        'tax_exemption_code': '',
                        'stock_on_hand': 2,
                        'has_attachment': false,
                        'is_combo_product': false,
                        'cf_category': 'Monitor',
                        'cf_maximum_retail_price_mrp': '0',
                        'created_time': '2018-08-31T12:53:35+0530',
                        'last_modified_time': '2018-12-13T21:01:59+0530',
                        'track_serial_number': false
                    },
                    {
                        'item_id': '519558000005612779',
                        'name': 'ADATA XPG GAMMIX D10 8GB DDR4 RAM 2666MHz for Desktop RAM',
                        'image_document_id': '',
                        'item_name': 'ADATA XPG GAMMIX D10 8GB DDR4 RAM 2666MHz for Desktop RAM',
                        'hsn_or_sac': '8473',
                        'sku': 'AX4U266638G16-SRG',
                        'image_name': '',
                        'status': 'active',
                        'source': 'user',
                        'is_linked_with_zohocrm': false,
                        'zcrm_product_id': '',
                        'description': '',
                        'item_tax_preferences': [
                            {
                                'tax_specification': 'inter',
                                'tax_type': 0,
                                'tax_name': 'IGST18',
                                'tax_percentage': 18,
                                'tax_id': '519558000000076071'
                            },
                            {
                                'tax_specification': 'intra',
                                'tax_type': 2,
                                'tax_name': 'GST18',
                                'tax_percentage': 18,
                                'tax_id': '519558000000076077'
                            }
                        ],
                        'rate': 4999,
                        'tax_id': '',
                        'reorder_level': '',
                        'tax_name': '',
                        'tax_percentage': 0,
                        'purchase_account_id': '519558000000043003',
                        'purchase_account_name': 'Cost of Goods Sold',
                        'account_name': 'Sales',
                        'unit': 'Unit',
                        'purchase_description': '',
                        'purchase_rate': 3100,
                        'item_type': 'inventory',
                        'product_type': 'goods',
                        'is_taxable': true,
                        'tax_exemption_id': '',
                        'tax_exemption_code': '',
                        'stock_on_hand': 2,
                        'has_attachment': false,
                        'is_combo_product': false,
                        'cf_category': 'RAM',
                        'cf_maximum_retail_price_mrp': '14999',
                        'created_time': '2019-03-01T18:06:05+0530',
                        'last_modified_time': '2019-04-27T17:08:53+0530',
                        'track_serial_number': false
                    }
                ],
                'page_context': {
                    'page': 1,
                    'per_page': 200,
                    'has_more_page': true,
                    'report_name': 'Items',
                    'applied_filter': 'Status.All',
                    'custom_fields': [],
                    'sort_column': 'name',
                    'sort_order': 'A'
                }
            }
        ";

        Product product = JsonConvert.DeserializeObject<Product>(data);
        List<Item> items = product.Items;

    }
}

Voici un exemple de code pour le dé-sérialiser correctement.

public class Product
{
    [JsonProperty("code")]
    public int Code { get; set; }

    [JsonProperty("message")]
    public string Message { get; set; }

    [JsonProperty("items")]
    public List<Item> Items { get; set; }

    [JsonProperty("page_context")]
    public PageContext PageContext { get; set; }
}

public class PageContext
{
    [JsonProperty("page")]
    public int Page { get; set; }

    [JsonProperty("per_page")]
    public int PerPage { get; set; }

    [JsonProperty("has_more_page")]
    public bool HasMorePage { get; set; }

    [JsonProperty("report_name")]
    public string ReportName { get; set; }

    [JsonProperty("applied_filter")]
    public string AppliedFilter { get; set; }

    [JsonProperty("custom_fields")]
    public object[] CustomFields { get; set; }

    [JsonProperty("sort_column")]
    public string SortColumn { get; set; }

    [JsonProperty("sort_order")]
    public string SortOrder { get; set; }
}

public class Item
{
    [JsonProperty("item_id")]
    public string ItemId { get; set; }

    [JsonProperty("name")]
    public string Name { get; set; }

    [JsonProperty("image_document_id")]
    public string ImageDocumentId { get; set; }

    [JsonProperty("item_name")]
    public string ItemName { get; set; }

    [JsonProperty("hsn_or_sac")]
    public string HsnOrSac { get; set; }

    [JsonProperty("sku")]
    public string SKU { get; set; }

    [JsonProperty("image_name")]
    public string ImageName { get; set; }

    [JsonProperty("status")]
    public string Status { get; set; }

    [JsonProperty("source")]
    public string Source { get; set; }

    [JsonProperty("is_linked_with_zohocrm")]
    public bool IsLinkedWithZohocrm { get; set; }

    [JsonProperty("zcrm_product_id")]
    public string ZcrmProductId { get; set; }

    [JsonProperty("description")]
    public string Description { get; set; }

    [JsonProperty("item_tax_preferences")]
    public ItemTaxPreference[] ItemTaxPreferences { get; set; }

    [JsonProperty("rate")]
    public float Rate { get; set; }

    [JsonProperty("tax_id")]
    public string TaxId { get; set; }

    [JsonProperty("reorder_level")]
    public string ReorderLevel { get; set; }

    [JsonProperty("tax_name")]
    public string TaxName { get; set; }

    [JsonProperty("tax_percentage")]
    public int TaxPercentage { get; set; }

    [JsonProperty("purchase_account_id")]
    public string PurchaseAccountId { get; set; }

    [JsonProperty("purchase_account_name")]
    public string PurchaseAccountName { get; set; }

    [JsonProperty("account_name")]
    public string AccountName { get; set; }

    [JsonProperty("unit")]
    public string Unit { get; set; }

    [JsonProperty("purchase_description")]
    public string PurchaseDescription { get; set; }

    [JsonProperty("purchase_rate")]
    public int PurchaseRate { get; set; }

    [JsonProperty("item_type")]
    public string ItemType { get; set; }

    [JsonProperty("product_type")]
    public string ProductType { get; set; }

    [JsonProperty("is_taxable")]
    public bool IsTaxable { get; set; }

    [JsonProperty("tax_exemption_id")]
    public string TaxExemptionId { get; set; }

    [JsonProperty("tax_exemption_code")]
    public string TaxExemptionCode { get; set; }

    [JsonProperty("has_attachment")]
    public bool HasAttachment { get; set; }

    [JsonProperty("is_combo_product")]
    public bool IsComboProduct { get; set; }

    [JsonProperty("created_time")]
    public DateTime CreatedTime { get; set; }

    [JsonProperty("last_modified_time")]
    public DateTime LastModifiedTime { get; set; }

    [JsonProperty("track_serial_number")]
    public bool TrackSerialNumber { get; set; }

    [JsonProperty("stock_on_hand")]
    public int StockOnHand { get; set; }

    [JsonProperty("cf_category")]
    public string CfCategory { get; set; }

    [JsonProperty("cf_maximum_retail_price_mrp")]
    public string CfMaximumRetailPriceMRP { get; set; }
}

public class ItemTaxPreference
{
    [JsonProperty("tax_specification")]
    public string TaxSpecification { get; set; }

    [JsonProperty("tax_type")]
    public int tax_type { get; set; }

    [JsonProperty("tax_name")]
    public string TaxName { get; set; }

    [JsonProperty("tax_percentage")]
    public int TaxPercentage { get; set; }

    [JsonProperty("tax_id")]
    public string TaxId { get; set; }
}


0 commentaires