protected virtual async Task <List <Activity> > addLocationFromActivity(AmblOnGraph amblGraph, string email, string entLookup, List <ActivityLocationLookup> activityLocations) { var activities = new List <Activity>(); foreach (ActivityLocationLookup acLoc in activityLocations) { var location = await amblGraph.ensureLocation(email, entLookup, acLoc.Location); acLoc.Activity.LocationID = location.ID; activities.Add(acLoc.Activity); // var existing = State.AllUserLocations.FirstOrDefault(x => x.ID == location.ID); // if (existing == null){ // State.AllUserLocations.Add(location); // } } return(activities); }
protected virtual async Task <Status> addLocationFromSharedItinerary(AmblOnGraph amblGraph, string email, string entLookup, Itinerary itinerary) { await itinerary.ActivityGroups.Each(async (activityGroup) => { await activityGroup.Activities.Each(async(activity) => { if (activity.LocationID.HasValue && activity.LocationID != Guid.Empty) { var location = await amblGraph.ensureLocation(email, entLookup, activity.LocationID); // var existing = State.AllUserLocations.FirstOrDefault(x => x.ID == location.ID); // if (existing == null){ // State.AllUserLocations.Add(location); // } } }); }); return(Status.Success); }