c# - Extract List<List<double> to list<double> -


am trying deserialise json below

[{"herelist":{"values":[[13.38,52.51],[13.428,52.523]]},"type":"double"}] 

as following

public class herelist {     public list<list<double>> values { get; set; }     public string type { get; set; } } 

can guide how extract values ([[a,b],[c,d]]) single list here.

tried thing

herelist ge = new herelist();         var x = ge.values;          foreach(var val in x)//[13.38,52.51]         {            //pupulate list<double> //[13.38,52.51]         } 

use ienumerable<t>.selectmany.

herelist ge = new herelist(); var allvalues = ge.values.selectmany(x => x).tolist(); 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

java - How to implement an entity bound odata action in olingo v4.3 -