I am new to .NET core and currently playing around with a WPF .NET Core app. I structured my solution with three different projects: View, ViewModel and Model.
My Model contains the business logic and in it I fetch invoice data from different sources. Now I need to exclude invoices with certain invoice numbers. I decided to define these numbers inside the appsettings.json file. After some research I learned I must initialize the IConfigurationBuilder instance inside the OnStartup() method in the App.xaml.cs file in the View project. I read the config classes are supposed to be defined in the target project (in my case the Model project) and used in the OnStartup() method of the View project, so Dependency Injection can be used to pass the config class to the target project, like described in this link.
However, for this method to work, I must add a dependency to my Model project in my View project, so the config class can be accessed there. I believe this would violate the MVVM pattern - at least how I understand it.
How would you tackle this problem? What are the best practices here? Or am I doing things completely wrong? I am also open for suggestions to use a completely different approach.