Как правильно написать класс для десериализации JSON
{"01":{"tz":{"251713":{"24586452":{"id":251713,"order":"305510010923","date":"2023-09-01 11:05:51","stock":3,"price_in":9743,"price_out":12315}},"982446":{"24571705":{"id":982446,"order":"131210010923","date":"2023-09-01 11:11:16","stock":1,"price_in":92,"price_out":233}},"65341":{"24571705":{"id":65341,"order":"131210010923","date":"2023-09-01 11:11:16","stock":3138,"price_in":1,"price_out":23},"24588297":{"id":65341,"order":"101115010923","date":"2023-09-01 15:14:14","stock":3114,"price_in":1,"price_out":23},"24588679":{"id":65341,"order":"372817010923","date":"2023-09-01 17:39:55","stock":3103,"price_in":1,"price_out":23},"24588836":{"id":65341,"order":"145618010923","date":"2023-09-01 18:58:48","stock":3095,"price_in":1,"price_out":23}}}}}
Пробовал вот так, но не работает:
public class Root
{
public Dictionary<string, Item> Items { get; set; }
}
public class Item
{
public Dictionary<string, Order> Orders { get; set; }
}
public class Order
{
public Dictionary<string, Product> Product { get; set; }
}
public class Product
{
public int Id { get; set; }
public string OrderNumber { get; set; }
public string Date { get; set; }
public int Stock { get; set; }
public int PriceIn { get; set; }
public int PriceOut { get; set; }
}