public static void MapVoyager(this IEndpointRouteBuilder endpoints, VoyagerMapOptions options = null) { var voyagerEndpoints = endpoints.ServiceProvider.GetRequiredService <IEnumerable <VoyagerRouteDefinition> >(); var voyagerOptionsHolder = endpoints.ServiceProvider.GetRequiredService <VoyagerOptionsHolder>(); options ??= new VoyagerMapOptions(); voyagerOptionsHolder.MapOptions = options; endpoints.DataSources.Add(new VoyagerDataSource(voyagerEndpoints, options)); }
public VoyagerDataSource(IEnumerable <VoyagerRouteDefinition> voyagerRoutes, VoyagerMapOptions mapOptions) { this.voyagerRoutes = voyagerRoutes; this.mapOptions = mapOptions; }