public async Task StoreAsync(Spot.Spot spot) { Database db = this.ReadOrCreateDatabase(); DocumentCollection collection = this.ReadOrCreateCollection(db.SelfLink, spotsCollectionId); await client.CreateDocumentAsync(collection.SelfLink, spot); }
public async Task<string> CreateNewSpot(string name, string description, double[][] directions, Location location, Conditions conditions, Levels levels) { string spotid = _spotrepsitory.GetNextSpotId(); Spot newspot = new Spot(spotid, name, description, directions, location, conditions, levels); await _spotsearchrepository.AddPostAsync(newspot); await _spotrepsitory.StoreAsync(newspot); return spotid; }
public async Task UpdatePostAsync(Spot spot) { var client = new IndexManagementClient(connection); var result = await client.PopulateAsync("spot", new IndexOperation(IndexOperationType.Merge, "id", spot.Uid) .WithProperty("name", spot.Name) .WithProperty("description", spot.Description) .WithGeographyPoint("location", spot.Location.Longitude, spot.Location.Latitude) ); }