Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AppPoisModel
- {
- public int idPoiType { get; set; }
- public string sector { get; set; }
- public double latPoint { get; set; }
- public double lngPoint { get; set; }
- }
- var result = (from c in db.coord
- select new AppPoisModel
- {
- idPoiType = c.id,
- sector = c.sector,
- latPoint = c.latitude ?? 0,
- lngPoint = c.longitude ?? 0
- }).ToList();
- [
- {
- "$id": "1",
- "sector" : "A",
- "latPoint": 0,
- "lngPoint": 0
- },
- {
- "$id": "2",
- "sector" : "A",
- "latPoint": 0,
- "lngPoint": 0
- }
- ]
- [
- {
- "$id": "1",
- "sector" : "A",
- "coords": [{latPoint, lngPoint}, {latPoint, lngPoint}]
- }
- ]
Add Comment
Please, Sign In to add comment