Сервис выдает данные в формате json { "request":{ "Target":"Offer", "Format":"json", "Service":"HasOffers", "Version":"2", "NetworkId":"22", "NetworkToken":"33", "Method":"findAll", "limit":"3", "page":"10" }, "response":{ "status":1, "httpStatus":200, "data":{ "page":"10", "current":27, "count":40269, "pageCount":13423, "data":{ "58":{ "Offer":{ "id":"58", "display_advertiser":"0", "advertiser_id":"500", "name":"name1", "description":"", "require_approval":"0", "require_terms_and_conditions":0, "terms_and_conditions":null, "preview_url":"", "offer_url":"", "currency":null, "default_payout":"0.02000", } }, "60":{ "Offer":{ "id":"60", "display_advertiser":"0", "advertiser_id":"500", "name":"name2", "description":"", "require_approval":"0", "require_terms_and_conditions":0, "terms_and_conditions":null, "preview_url":"http:\/\/wap.mozzi.com\/ES_FRIENDFINDER\/affid=YZM&sem=N", "offer_url":"http:\/\/wap.mozzi.com\/ES_FRIENDFINDER\/affid=YZM&sem=N&transaction_id={transaction_id}&pubid={pub_id}", "currency":null, "default_payout":"0.05000", } } } }, "errors":[ ], "errorMessage":null } } Through the online code generator, and through the built-in generator, Visual Studio produces the following class view, which in fact is not entirely correct, since it writes each id as a property of the class. Tell me what am I doing wrong? *
public class Request { public string Target { get; set; } public string Format { get; set; } public string Service { get; set; } public string Version { get; set; } public string NetworkId { get; set; } public string NetworkToken { get; set; } public string Method { get; set; } public string limit { get; set; } public string page { get; set; } } public class Offer { public string id { get; set; } public string display_advertiser { get; set; } public string advertiser_id { get; set; } public string name { get; set; } public string description { get; set; } public string require_approval { get; set; } public int require_terms_and_conditions { get; set; } public object terms_and_conditions { get; set; } public string preview_url { get; set; } public string offer_url { get; set; } public object currency { get; set; } public string default_payout { get; set; } } public class 58 { public Offer Offer { get; set; } } public class 60 { public Offer { get; set; } } public class Data { public 58 58 { get; set; } public 60 60 { get; set; } } public class Data { public string page { get; set; } public int current { get; set; } public int count { get; set; } public int pageCount { get; set; } public Data data { get; set; } } public class Response { public int status { get; set; } public int httpStatus { get; set; } public Data data { get; set; } public IList<object> errors { get; set; } public object errorMessage { get; set; } } public class Example { public Request request { get; set; } public Response response { get; set; } }