1

I am making a function using Azure Functions and Azure Cosmos db (mongo db api) and i need to make a model for the data. One of the fields need to be a array of array but I cant find how to declare an array of array for a method

This is my model

namespace GeofencedLocations.Models
{
    public class Geofence
    {
        [BsonId]
        [BsonRepresentation(BsonType.ObjectId)]
        public string LocationId { get; set; }
        [BsonElement("Location name")]
        public string LocationName { get; set; }
/// this is where i need to declare an array of array
        [BsonElement("Location Coordinates")]
        public string LocationCoordinates { get; set; }
        [BsonElement("user ID")]
        public string userID { get; set; }
    }
}

Location Co-ordinates will an array of array, something like this in json

 {
   "lat" : "000'00",
   "lon": "000'99"
 },
 {
   "lat" : "000'00",
   "lon": "000'99"
 }

]
David Makogon
  • 69,407
  • 21
  • 141
  • 189
Muskan
  • 11
  • 1
  • 1
    Do you just need `public LocationCoordinate[] LocationCoordinates { get; set; }` with `public class LocationCoordinate { public string Latitude { get; set; } public string Longitude { get; set; } }`? – Enigmativity Jul 16 '22 at 05:38
  • 1
    Does the database support to array? Make a table of points with id (primary key), lat, lon then link with other tables. – jdweng Jul 16 '22 at 08:05

0 Answers0