Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix missing xml docs for return value
Add other missing builder extension method return value and xml docs.
  • Loading branch information
pherbel committed Mar 26, 2018
commit 11640caaee2dbf693ab2127a63eb635b8bacc16e
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static class NodeServicesServiceCollectionExtensions
/// Adds NodeServices support to the <paramref name="serviceCollection"/>.
/// </summary>
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IServiceCollection AddNodeServices(this IServiceCollection serviceCollection)
=> AddNodeServices(serviceCollection, _ => {});

Expand All @@ -20,6 +21,7 @@ public static IServiceCollection AddNodeServices(this IServiceCollection service
/// </summary>
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
/// <param name="setupAction">A callback that will be invoked to populate the <see cref="NodeServicesOptions"/>.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IServiceCollection AddNodeServices(this IServiceCollection serviceCollection, Action<NodeServicesOptions> setupAction)
{
if (setupAction == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public static class AngularCliMiddlewareExtensions
/// </summary>
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
/// <param name="npmScript">The name of the script in your package.json file that launches the Angular CLI process.</param>
public static void UseAngularCliServer(
/// <returns>A reference to this instance after the operation has completed.</returns>
public static ISpaBuilder UseAngularCliServer(
this ISpaBuilder spaBuilder,
string npmScript)
{
Expand All @@ -38,6 +39,7 @@ public static void UseAngularCliServer(
}

AngularCliMiddleware.Attach(spaBuilder, npmScript);
return spaBuilder;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static class SpaPrerenderingExtensions
/// </summary>
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
/// <param name="configuration">Supplies configuration for the prerendering middleware.</param>
public static void UseSpaPrerendering(
/// <returns>A reference to this instance after the operation has completed.</returns>
public static ISpaBuilder UseSpaPrerendering(
this ISpaBuilder spaBuilder,
Action<SpaPrerenderingOptions> configuration)
{
Expand Down Expand Up @@ -174,6 +175,7 @@ await buildOnDemandTask.WithTimeout(buildTimeout,
await ServePrerenderResult(context, renderResult);
}
});
return spaBuilder;
}

private static bool IsHtmlContentType(string contentType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ public static class SpaProxyingExtensions
/// </summary>
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
/// <param name="baseUri">The target base URI to which requests should be proxied.</param>
public static void UseProxyToSpaDevelopmentServer(
/// <returns>A reference to this instance after the operation has completed.</returns>
public static ISpaBuilder UseProxyToSpaDevelopmentServer(
this ISpaBuilder spaBuilder,
string baseUri)
{
UseProxyToSpaDevelopmentServer(
spaBuilder,
new Uri(baseUri));
return UseProxyToSpaDevelopmentServer(
spaBuilder,
new Uri(baseUri));
}

/// <summary>
Expand All @@ -39,13 +40,14 @@ public static void UseProxyToSpaDevelopmentServer(
/// </summary>
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
/// <param name="baseUri">The target base URI to which requests should be proxied.</param>
public static void UseProxyToSpaDevelopmentServer(
/// <returns>A reference to this instance after the operation has completed.</returns>
public static ISpaBuilder UseProxyToSpaDevelopmentServer(
this ISpaBuilder spaBuilder,
Uri baseUri)
{
UseProxyToSpaDevelopmentServer(
spaBuilder,
() => Task.FromResult(baseUri));
return UseProxyToSpaDevelopmentServer(
spaBuilder,
() => Task.FromResult(baseUri));
}

/// <summary>
Expand All @@ -55,7 +57,8 @@ public static void UseProxyToSpaDevelopmentServer(
/// </summary>
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
/// <param name="baseUriTaskFactory">A callback that will be invoked on each request to supply a <see cref="Task"/> that resolves with the target base URI to which requests should be proxied.</param>
public static void UseProxyToSpaDevelopmentServer(
/// <returns>A reference to this instance after the operation has completed.</returns>
public static ISpaBuilder UseProxyToSpaDevelopmentServer(
this ISpaBuilder spaBuilder,
Func<Task<Uri>> baseUriTaskFactory)
{
Expand All @@ -79,6 +82,8 @@ public static void UseProxyToSpaDevelopmentServer(
context, neverTimeOutHttpClient, baseUriTaskFactory(), applicationStoppingToken,
proxy404s: true);
});

return spaBuilder;
}

private static CancellationToken GetStoppingToken(IApplicationBuilder appBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class ReactDevelopmentServerMiddlewareExtensions
/// </summary>
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
/// <param name="npmScript">The name of the script in your package.json file that launches the create-react-app server.</param>
public static void UseReactDevelopmentServer(
public static ISpaBuilder UseReactDevelopmentServer(
this ISpaBuilder spaBuilder,
string npmScript)
{
Expand All @@ -38,6 +38,8 @@ public static void UseReactDevelopmentServer(
}

ReactDevelopmentServerMiddleware.Attach(spaBuilder, npmScript);

return spaBuilder;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static class SpaApplicationBuilderExtensions
/// This callback will be invoked so that additional middleware can be registered within
/// the context of this SPA.
/// </param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IApplicationBuilder UseSpa(this IApplicationBuilder app, Action<ISpaBuilder> configuration)
{
if (configuration == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static class SpaStaticFilesExtensions
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/>.</param>
/// <param name="configuration">If specified, this callback will be invoked to set additional configuration options.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IServiceCollection AddSpaStaticFiles(
this IServiceCollection services,
Action<SpaStaticFilesOptions> configuration = null)
Expand Down Expand Up @@ -50,6 +51,7 @@ public static IServiceCollection AddSpaStaticFiles(
/// The files will be located using the registered <see cref="ISpaStaticFileProvider"/> service.
/// </summary>
/// <param name="applicationBuilder">The <see cref="IApplicationBuilder"/>.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IApplicationBuilder UseSpaStaticFiles(this IApplicationBuilder applicationBuilder)
{
return UseSpaStaticFiles(applicationBuilder, new StaticFileOptions());
Expand All @@ -61,6 +63,7 @@ public static IApplicationBuilder UseSpaStaticFiles(this IApplicationBuilder app
/// </summary>
/// <param name="applicationBuilder">The <see cref="IApplicationBuilder"/>.</param>
/// <param name="options">Specifies options for serving the static files.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IApplicationBuilder UseSpaStaticFiles(this IApplicationBuilder applicationBuilder, StaticFileOptions options)
{
if (applicationBuilder == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static class PrerenderingServiceCollectionExtensions
/// of <see cref="ISpaPrerenderer"/>.
/// </summary>
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IServiceCollection AddSpaPrerenderer(this IServiceCollection serviceCollection)
{
serviceCollection.AddHttpContextAccessor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ public static class SpaRouteExtensions
/// <param name="defaults">Default route parameters.</param>
/// <param name="constraints">Route constraints.</param>
/// <param name="dataTokens">Route data tokens.</param>
public static void MapSpaFallbackRoute(
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IRouteBuilder MapSpaFallbackRoute(
this IRouteBuilder routeBuilder,
string name,
object defaults,
object constraints = null,
object dataTokens = null)
{
MapSpaFallbackRoute(
return MapSpaFallbackRoute(
routeBuilder,
name,
/* templatePrefix */ null,
Expand All @@ -49,7 +50,8 @@ public static void MapSpaFallbackRoute(
/// <param name="defaults">Default route parameters.</param>
/// <param name="constraints">Route constraints.</param>
/// <param name="dataTokens">Route data tokens.</param>
public static void MapSpaFallbackRoute(
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IRouteBuilder MapSpaFallbackRoute(
this IRouteBuilder routeBuilder,
string name,
string templatePrefix,
Expand All @@ -61,7 +63,7 @@ public static void MapSpaFallbackRoute(
var constraintsDict = ObjectToDictionary(constraints);
constraintsDict.Add(ClientRouteTokenName, new SpaRouteConstraint(ClientRouteTokenName));

routeBuilder.MapRoute(name, template, defaults, constraintsDict, dataTokens);
return routeBuilder.MapRoute(name, template, defaults, constraintsDict, dataTokens);
}

private static string CreateRouteTemplate(string templatePrefix)
Expand Down