Update to .NET Core 3.1 and apply Roslyn suggestions

This commit is contained in:
2020-07-18 16:41:01 +00:00
parent e893299224
commit de0d6cdc82
20 changed files with 169 additions and 102 deletions

View File

@@ -38,7 +38,7 @@ namespace ChrisKaczor.HomeMonitor.Power.Service.Data
var databaseExists = (bool?)command.ExecuteScalar();
// Create database if needed
if (!databaseExists.GetValueOrDefault(false))
if (!(databaseExists ?? false))
{
command.CommandText = $"CREATE DATABASE {_configuration["Power:Database:Name"]}";
command.ExecuteNonQuery();