Search code examples
.net-coredesign-patternsentity-framework-corecross-platform

How to Implement MVVM in a .NET Core Console Application?


I’d like to use .Net Core (Console App) and EF Core to create my business logic, a number crunching engine that loads financial data from a local database (MySQL or SQLite), process it, will store the results in the same database and show them to the user.

I want to be able to easily add in the future a GUI to manage the CRUD operations and simple commands.

How can I implement the MVVM pattern in a console application to be able to easily add a GUI in the future (Win7-10 and MacOs)?


Solution

  • The Terminal.Gui Nuget package includes:

    Reactive Example - A sample app that shows how to use System.Reactive and ReactiveUI with Terminal.Gui. The app uses the MVVM architecture that may seem familiar to folks coming from WPF, Xamarin Forms, UWP, Avalonia, or Windows Forms. In this app, we implement the data bindings using ReactiveUI WhenAnyValue syntax and Pharmacist — a tool that converts all events in a NuGet package into observable wrappers.