From c60935b79340508c37c9d5cffcd49ae330d5540b Mon Sep 17 00:00:00 2001 From: Alexis Drai Date: Sat, 1 Oct 2022 20:21:28 +0000 Subject: [PATCH] Update 'README.md' --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 8bbb37b..69e6130 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,40 @@ ## To use the app +### Console prototype + Open the *DiceAppConsole.sln* solution and navigate to the *App* project. The *Program.cs* file has a `Main()` method that can be launched. *If you simply load DiceApp.sln, Visual Studio will not load the App project...* The console prototype loads a stub with a few small games that you can test, and you can create new everything (with a little patience). +### DiceApp DB context with stub + +We also now have a budding persistence solution, using Entity Framework. + +Open the any of our *solutions* and navigate to the *Data* project. The *Program.cs* file has a `Main()` method that can be launched. + +The NuGet packages are managed in files that are versioned, so you shouldn't need to manage the dependencies yourself. *"The Line"* is taken care of too. + +However, you do need to create the migrations and DB. + +First, in Visual Studio's terminal ("Developer PowerShell"), go to *DiceApp/Sources/Data*, and make sure Entity Framework is installed and / or updated. +``` +dotnet tool install --global dotnet-ef +dotnet tool update --global dotnet-ef +``` +Now the migrations and DB. Since we have a `DbContext` *and* and `DbContextWithStub`, you will need to specify which one to use. Make sure you are in *DiceApp/Sources/Data*. +``` +dotnet ef migrations add dice_app_db --context DiceAppDbContextWithStub +dotnet ef database update --context DiceAppDbContextWithStub +``` +You can now run the *Data* program, and check out your local DB. + +You may not want to read tables in the debug window -- in which case, just download [DB Brower for SQLite](https://sqlitebrowser.org/dl/) and open the *.db* file in it. + +Ta-da. + ## To contribute (workflow) We are using the feature branch workflow ([details here](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow), or see the summary below)