# FMS Admin Backend

## 설치

.Net Core 설치

<https://dotnet.microsoft.com/download/dotnet-core/3.1>

.appsettings.Development.json 파일생성

```
.appsettings.Development.json.example 복사
```

Trust the HTTPS

```
dotnet dev-certs https --trust
```

## EF Tool 설치

```
dotnet tool install --global dotnet-ef
```

## 패키지 설치 (빌드시 자동설치됨)

EF Core Package 추가

```
dotnet add package Microsoft.EntityFrameworkCore.Design --version 3.1.0

dotnet add package Microsoft.EntityFrameworkCore.Sqlite --version 3.1.0
dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 3.1.0

dotnet add package Microsoft.EntityFrameworkCore.Proxies --version 3.1.0
```

EPPlus (Excel 출력)

```
dotnet add package EPPlus --version 4.5.3.2
```

Linq Dynamic (Core)

```
dotnet add package System.Linq.Dynamic.Core --version 1.0.19
```

LinqKit (Core)

```
dotnet add package LinqKit.Microsoft.EntityFrameworkCore --version 3.0.0
```

Versioning 패키지

```
dotnet add package Microsoft.AspNetCore.Mvc.Versioning --version 4.1.0
```

Quartz Job Scheduler

```
dotnet add package Quartz --version 3.0.7
```

QR Code Generator (QrCode.Net)

```
dotnet add package QRCoder
```

SixLabors ImageSharp (이미지 프로세싱)

```
dotnet add package SixLabors.ImageSharp
```

Serilog (로거)

```
dotnet add package Serilog.AspNetCore --version 3.4.0
```

ActiveReports Viewer (레포트 프로그램, 상용)

```
dotnet add package GrapeCity.ActiveReports.Aspnetcore.Viewer
```

Select Pdf (PDF 이미지 컨버터 모듈, 상용)

```
dotnet add package Select.Pdf.NetCore
```

## test database 생성

```
appsettings.Development.json 수정
"Server": "Sqlite"

dotnet ef migrations add init
dotnet ef database update
```

## 환경설정

포트 설정

appsettings.Development.json

```
  "Kestrel": {
    "EndPoints": {
      "Http": {
        "Url": "http://0.0.0.0:9090"
      }
    }
  }
```

## 추가 도움툴

DB Browser for SQLite : QLite 클라이언트

- <https://sqlitebrowser.org/>

RestClient : API 테스트 클라이언트

- <https://marketplace.visualstudio.com/items?itemName=humao.rest-client>

PostMan : API 테스트 클라이언트

- <https://www.getpostman.com/>

## 참고자료

ASP.NET Core MVC Tutorial

- <https://docs.microsoft.com/ko-kr/aspnet/core/tutorials/first-mvc-app/?view=aspnetcore-3.1>

Entity Framework Core

- <https://docs.microsoft.com/ko-kr/ef/core/>

ASP.NET Core Web API

- <https://docs.microsoft.com/ko-kr/aspnet/core/web-api/?view=aspnetcore-3.1>

JWT 인증

- <https://jwt.io/>
- <https://jasonwatmore.com/post/2019/10/11/aspnet-core-3-jwt-authentication-tutorial-with-example-api>

C# 새로운 기능 (8.0 ~ 6)

- <https://docs.microsoft.com/ko-kr/dotnet/csharp/whats-new/csharp-8>

## 기타

SQL 제네레이터 (ef migrations)

```
※ dotnet ef migrations add init 등 마이그레이션 작업후
dotnet ef migrations script | out-file ./script.sql
```

서버 설치

- <https://dotnet.microsoft.com/download/dotnet-core/3.1> Core Runtime 설치 (dotnet-hosting-3.1.1-win.exe)

- <https://www.iis.net/downloads/microsoft/url-rewrite> IIS URL Rewrite 모듈
