Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Latest commit

 

History

History
49 lines (36 loc) · 2.63 KB

README.md

File metadata and controls

49 lines (36 loc) · 2.63 KB

StorageService - ALpha 0.1

Master Develop
None Build Status

Intro

StorageService is a service for manipulating with data in relation database (PostrgeSQL). It uses .NET Core 3.1 and ASP.NET Core Web API

Setup

Before you run the project, make sure you have got PostgreSQL server running, and you have enforced HTTPS

Database setup:

Modify ""PostgreSQL" string in appsettings.json if your credentials for database is different from mine.

We use Entity Framework Core 3.0 as ORM and Code First approach.

To start with, install EF Core CLI tools: by running following:

dotnet tool install --global dotnet-ef

Then, we need to setup migrations directory (which is by default would be located in GameStorageService/GameStorageService) by running the following command in GameStorageService project directory:

dotnet ef migrations add Init

After that, EF Core will generate first migration to apply to the database, and we can run the command to generate SQL query generating all the tables in our database

dotnet ef database update

by default, migration assembly is set as GameStorageService, but you can change it by modifying .MigrationsAssembly() parameter in Startup.cs :

services.AddDbContext<DomainContext>(options =>
                options.UseNpgsql(Configuration.GetConnectionString("PostgreSQL"), builder => 
                    builder.MigrationsAssembly("GameStorageService")));

Contribution

All developers are always welcome to contribute to the project and open issues and pull-requests with appropriate messages.

License

The code is licensed under the GNU General Public License v2.0

Copyright © 2013-2018 Serilog Contributors

Licensed under Apache License 2.0