보관함

dotnet core api version

출처 : https://dotnetcoretutorials.com/2017/01/17/api-versioning-asp-net-core/

Install-Package Microsoft.AspNetCore.Mvc.Versioning

startup.cs

public void ConfigureServices(IServiceCollection services) { // ApiVersioning을 추가 services.AddApiVersioning(options => { // 클라이언트에 Api 버전을 통지 options.ReportApiVersions = true; // 이것이 없으면 클라이언트 측에서 에러가 나온다 options.AssumeDefaultVersionWhenUnspecified = true; // Api의 default 버전을 1.0으로 설정 options.DefaultApiVersion = new ApiVersion(1, 0); }); }

출처에 보면 여러가지 방식(Url Query Based […]

vscode go Example실행

프로젝트용 폴더 생성

main.go 파일 생성

package main import “fmt” func main() { fmt.Println(“hello world”) }

vscode 로 폴더 열기

F5 로 실행 -> Error

dlv 파일이 없어서 생긴 문제 인것 같아서 일단 delve 패키지 install

brew install delve

하지만

go: go.mod file not found in current directory or any parent directory; see […]

csharp 몇몇 코드 단순화

in 매개 변수

// 여기서의 in은 ref readonly처럼 작동함 함수 call시에는 in을 쓰거나 말거나 동일 void PrintDate(in DateTime date) { Console.WriteLine(date); }

null 관련 연산자

// 오래전 instance = instance == null ? value : instance; // 기존 instance = instance ?? value; // 현재 instance ??= value;

Auto Property

// C# 6.0 Auto […]