mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 13:07:07 +01:00
Simplify a null check
This commit is contained in:
@@ -245,11 +245,8 @@ namespace Tgstation.Server.Host.Database
|
||||
const string ConfigureMethodName = nameof(SqlServerDatabaseContext.ConfigureWith);
|
||||
var configureFunction = typeof(TDatabaseContext).GetMethod(
|
||||
ConfigureMethodName,
|
||||
BindingFlags.Public | BindingFlags.Static);
|
||||
|
||||
if (configureFunction == null)
|
||||
throw new InvalidOperationException($"Context type {typeof(TDatabaseContext).FullName} missing static {ConfigureMethodName} function!");
|
||||
|
||||
BindingFlags.Public | BindingFlags.Static)
|
||||
?? throw new InvalidOperationException($"Context type {typeof(TDatabaseContext).FullName} missing static {ConfigureMethodName} function!");
|
||||
return (optionsBuilder, config) => configureFunction.Invoke(null, new object[] { optionsBuilder, config });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user