Guest User

Untitled

a guest
Apr 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public class AppPoisModel
  2. {
  3. public int idPoiType { get; set; }
  4. public string sector { get; set; }
  5. public double latPoint { get; set; }
  6. public double lngPoint { get; set; }
  7. }
  8.  
  9. var result = (from c in db.coord
  10. select new AppPoisModel
  11. {
  12. idPoiType = c.id,
  13. sector = c.sector,
  14. latPoint = c.latitude ?? 0,
  15. lngPoint = c.longitude ?? 0
  16. }).ToList();
  17.  
  18. [
  19. {
  20. "$id": "1",
  21. "sector" : "A",
  22. "latPoint": 0,
  23. "lngPoint": 0
  24. },
  25. {
  26. "$id": "2",
  27. "sector" : "A",
  28. "latPoint": 0,
  29. "lngPoint": 0
  30. }
  31. ]
  32.  
  33. [
  34. {
  35. "$id": "1",
  36. "sector" : "A",
  37. "coords": [{latPoint, lngPoint}, {latPoint, lngPoint}]
  38. }
  39. ]
Add Comment
Please, Sign In to add comment