principalement du format de code

This commit is contained in:
Paul Schneider 2020-09-12 01:11:30 +01:00
commit ff1444d664
87 changed files with 510 additions and 550 deletions

View file

@ -91,8 +91,7 @@ namespace Yavsc
//
;
}
private void ConfigureOAuthApp(IApplicationBuilder app,
SiteSettings settingsOptions, ILogger logger)
private void ConfigureOAuthApp(IApplicationBuilder app)
{
app.UseIdentity();

View file

@ -13,15 +13,9 @@ namespace Yavsc
// * an AppData folder
public partial class Startup
{
public void CheckServices(IServiceCollection services)
{
}
public void CheckApp(IApplicationBuilder app,
SiteSettings siteSettings, IHostingEnvironment env,
ILoggerFactory loggerFactory
)
public void CheckApp(IHostingEnvironment env,
ILoggerFactory loggerFactory)
{
var logger = loggerFactory.CreateLogger<Startup>();

View file

@ -11,8 +11,7 @@ namespace Yavsc
{
public partial class Startup
{
public void ConfigureWebSocketsApp(IApplicationBuilder app,
SiteSettings siteSettings, IHostingEnvironment env)
public void ConfigureWebSocketsApp(IApplicationBuilder app)
{
var webSocketOptions = new WebSocketOptions()
{
@ -25,7 +24,7 @@ namespace Yavsc
app.UseSignalR(PathString.FromUriComponent(Constants.SignalRPath));
}
private async Task Echo(HttpContext context, WebSocket webSocket)
private async Task Echo(WebSocket webSocket)
{
var buffer = new byte[1024 * 4];
WebSocketReceiveResult result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);

View file

@ -30,7 +30,7 @@ namespace Yavsc
/// </summary>
public static readonly string[] Forms = new string[] { "Profiles", "HairCut" };
private void ConfigureWorkflow(IApplicationBuilder app, SiteSettings settings, ILogger logger)
private void ConfigureWorkflow()
{
// System.AppDomain.CurrentDomain.ResourceResolve += OnYavscResourceResolve;
@ -50,7 +50,7 @@ namespace Yavsc
}
catch (Exception ex)
{
logger.LogError(ex.TargetSite.Name);
_logger.LogError(ex.TargetSite.Name);
}
@ -64,7 +64,7 @@ namespace Yavsc
// TODO swith () case {}
if (typeof(IQueryable<ISpecializationSettings>).IsAssignableFrom(propinfo.PropertyType))
{// double-bingo
logger.LogVerbose($"Pro: {propinfo.Name}");
_logger.LogVerbose($"Pro: {propinfo.Name}");
BillingService.UserSettings.Add(propinfo);
}
else
@ -75,7 +75,7 @@ namespace Yavsc
base de donnée porte l'attribut [ActivitySetting],
mais n'implemente pas l'interface IQueryable<ISpecializationSettings>
({propinfo.MemberType.GetType()})";
logger.LogCritical(msg);
_logger.LogCritical(msg);
}
}
}

View file

@ -278,7 +278,6 @@ namespace Yavsc
{
options.ResourcesPath = "Resources";
});
CheckServices(services);
}
static ApplicationDbContext _dbContext;
public static IServiceProvider Services { get; private set; }
@ -288,7 +287,6 @@ namespace Yavsc
IApplicationBuilder app, IHostingEnvironment env,
ApplicationDbContext dbContext, IOptions<SiteSettings> siteSettings,
IOptions<RequestLocalizationOptions> localizationOptions,
IOptions<OAuth2AppSettings> oauth2SettingsContainer,
IAuthorizationService authorizationService,
IOptions<PayPalSettings> payPalSettings,
IOptions<GoogleAuthSettings> googleSettings,
@ -355,8 +353,10 @@ namespace Yavsc
app.UseDeveloperExceptionPage();
app.UseRuntimeInfoPage();
var epo = new ErrorPageOptions();
epo.SourceCodeLineCount = 20;
var epo = new ErrorPageOptions
{
SourceCodeLineCount = 20
};
app.UseDeveloperExceptionPage(epo);
app.UseDatabaseErrorPage(
x =>
@ -404,19 +404,22 @@ namespace Yavsc
});
app.UseSession();
ConfigureOAuthApp(app, SiteSetup, _logger);
ConfigureOAuthApp(app);
ConfigureFileServerApp(app, SiteSetup, env, authorizationService);
app.UseRequestLocalization(localizationOptions.Value, (RequestCulture)new RequestCulture((string)"en-US"));
ConfigureWorkflow(app, SiteSetup, _logger);
ConfigureWorkflow();
// Empty this odd chat user list from db
/*
foreach (var p in dbContext.ChatConnection)
{
dbContext.Entry(p).State = EntityState.Deleted;
}
dbContext.SaveChanges();
FIXME */
ConfigureWebSocketsApp(app, SiteSetup, env);
ConfigureWebSocketsApp(app);
app.UseMvc(routes =>
{
@ -451,7 +454,7 @@ namespace Yavsc
}
});
CheckApp(app, SiteSetup, env, loggerFactory);
CheckApp( env, loggerFactory);
}
// Entry point for the application.