Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with dotnet-format #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Configuration/JsonFileConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ internal static Stream MakeKeyPerJsonFileInputStream(this FileInfo jsonFile, ILo
json = $$$"""
{
"{{{Path.GetFileNameWithoutExtension(jsonFile.FullName)}}}":
{{{json}}}
{ { { json} } }
}
""";
return new MemoryStream(json.ToUTF8Bytes());
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Services/HttpServicesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ public static IHostApplicationBuilder AddHttpServices(
);
}

if(options.IIS != null)
if (options.IIS != null)
{
builder.Services.Configure<IISServerOptions>(
options =>
builder.Configuration.Bind($"{configurationSectionKey}:{IIS}", options)
);
}

if(options.Kestrel != null)
if (options.Kestrel != null)
{
builder.Services.Configure<KestrelServerOptions>(
options =>
Expand Down
24 changes: 12 additions & 12 deletions src/Http/Services/UseHttpServicesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static IApplicationBuilder UseHttpServices(this IApplicationBuilder app)
{
var options = app.ApplicationServices.GetRequiredService<IOptions<HttpServicesOptions>>().Value;

if(options.UseRequestDecompression)
if (options.UseRequestDecompression)
{
app.UseRequestDecompression();
}
Expand All @@ -21,37 +21,37 @@ public static IApplicationBuilder UseHttpServices(this IApplicationBuilder app)
app.UseResponseCompression();
}

if(options.UseFileServer)
if (options.UseFileServer)
{
app.UseFileServer(options.FileServer);

if(options.FileServer.EnableDefaultFiles)
if (options.FileServer.EnableDefaultFiles)
{
app.UseDefaultFiles(options.FileServer.DefaultFilesOptions);
}

if(options.FileServer.EnableDirectoryBrowsing)
if (options.FileServer.EnableDirectoryBrowsing)
{
app.UseDirectoryBrowser(options.FileServer.DirectoryBrowserOptions);
}

if(options.FileServer.StaticFileOptions != null)
if (options.FileServer.StaticFileOptions != null)
{
app.UseStaticFiles(options.FileServer.StaticFileOptions);
}
}

if(options.UseResponseCaching)
if (options.UseResponseCaching)
{
app.UseResponseCaching();
}

if(options.UseForwardedHeaders)
if (options.UseForwardedHeaders)
{
app.UseForwardedHeaders(options.ForwardedHeaders);
}

if(options.UseCors)
if (options.UseCors)
{
app.UseCors();
// _ = app.UseCors(corsOptions => corsOptions
Expand All @@ -63,22 +63,22 @@ public static IApplicationBuilder UseHttpServices(this IApplicationBuilder app)
// );
}

if(options.UseCookiePolicy)
if (options.UseCookiePolicy)
{
app.UseCookiePolicy(options.CookiePolicy);
}

if(options.UseSession)
if (options.UseSession)
{
app.UseSession(options.Session);
}

if(options.UseHsts)
if (options.UseHsts)
{
app.UseHsts();
}

if(options.UseHttpsRedirection)
if (options.UseHttpsRedirection)
{
app.UseHttpsRedirection();
}
Expand Down
12 changes: 6 additions & 6 deletions src/Mvc/IHostApplicationBuilderMvcExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static IHostApplicationBuilder AddMvc(this IHostApplicationBuilder builde
builder.Services.Configure<MvcOptions>(mvcOptionsSection);
var mvcOptions = mvcOptionsSection.Get<MvcOptions>();

if(mvcOptions is not null)
if (mvcOptions is not null)
{
#if NET5_0_OR_GREATER
if(mvcOptions.EnableEndpointRouting)
Expand All @@ -44,27 +44,27 @@ public static IHostApplicationBuilder AddMvc(this IHostApplicationBuilder builde
}
#endif

if(mvcOptions.AddControllersAsServices)
if (mvcOptions.AddControllersAsServices)
{
mvcBuilder.AddControllersAsServices();
}

if(mvcOptions.AddXmlSerializerFormatters)
if (mvcOptions.AddXmlSerializerFormatters)
{
mvcBuilder.AddXmlSerializerFormatters();
}

if(mvcOptions.AddXmlDataContractSerializerFormatters)
if (mvcOptions.AddXmlDataContractSerializerFormatters)
{
mvcBuilder.AddXmlDataContractSerializerFormatters();
}

if(mvcOptions.AddJsonOptions)
if (mvcOptions.AddJsonOptions)
{
mvcBuilder.AddJsonOptions(options => builder.Configuration.Bind(JsonSerializer, options));
}

if(mvcOptions.AddMvcConventions)
if (mvcOptions.AddMvcConventions)
{
// mvcBuilder.AddMvcOptions(options => builder.Configuration.Bind(configurationSectionKey, options));
}
Expand Down
Loading