보관함

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

csharp enum 을 사용하는 코드 샘플

출처 : https://qiita.com/mkuwan/items/be6745f2c9e7823f8a66

public static class TypeExtention { /// <summary> /// enumの値リストを取得 /// </summary> /// <typeparam name=”T”></typeparam> /// <returns></returns> public static List<T> GetEnumList<T>(this Type type) where T : Enum { return Enum.GetValues(typeof(T)).Cast<T>().ToList(); } /// <summary> /// enumのDescripntionリストを取得 /// </summary> /// <typeparam name=”T”></typeparam> /// <returns></returns> public static IEnumerable<string> GetEnumDescriptionEnumerable<T>(this Type type) where T : Enum […]

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