Skip to content

Commit

Permalink
fix: Throw if no setting found
Browse files Browse the repository at this point in the history
  • Loading branch information
data-miner00 committed Oct 20, 2024
1 parent d24a38e commit ea5ac08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Linker.Wpf/ContainerConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Linker.Wpf
{
using System;
using System.Data;
using System.Data.SQLite;
using Autofac;
Expand Down Expand Up @@ -31,7 +32,8 @@ public static IContainer Configure()

builder.RegisterModule(module);

var sqliteOptions = config.GetSection(typeof(SQLiteOption).Name).Get<SQLiteOption>();
var sqliteOptions = config.GetSection(typeof(SQLiteOption).Name).Get<SQLiteOption>()
?? throw new InvalidOperationException("The settings is missing");

var connection = new SQLiteConnection(sqliteOptions.ConnectionString);

Expand Down

0 comments on commit ea5ac08

Please sign in to comment.