보관함

2021년 6월 내가 설치한 vscode 확장들

최근에는 asp.net core 에 한정해서 개발을 하다보니 대부분 Disable 하고 필요한 것만 Enable 해서 사용

사용중 .NET Core Add Reference .NET Core Test Explorer .NET Install Tool for Extension Authors ASP.NET Core Switcher Auto Close Tag Auto Rename Tag Auto-Using for C# Bookmarks C# C# Namespace Autocompletion Code Spell Checker CSS Flexbox Cheatsheet CSS […]

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 […]

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 […]