c#
[C#] ref & out
🟦 ref & out ref와 out 모두 메서드에 인자를 전달할 때 사용된다. 하지만 차이점이 있으니 이를 고려해서 사용해야한다. 🟧 Document ref 문서 out 문서 🟧 ref 키워드 int a = 1; // 초기화 필수 // a라는 인자를 넘겨받음 public void ChangeValue(ref int a) { } - 해당 변수가 파라미터로 넘겨지기 전에 초기화를 해야한다. - 메서드 외부에서 메서드 내부로 값을 전달한다. 🟧 out 키워드 int a;// 초기화할 필요 없음. // 메서드 내부에서 처리한 값을 a에게 넘겨줌 public void ChangeValue(out int a) { } - 해당 변수를 초기화할 필요가 없다. - a라는 변수를 메서드 내부로 넘겨주는 것이 아니라, 메..
Interface, Abstract, Virtual
🟦 Interface, Abstract, Virtual - 패턴 책을 공부하는데 위의 개념이 잡히지않아 이해가 어려웠음 - 나름대로 이해한 것을 정리함 🟦 Interface 🟧 Document https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interface interface - C# Reference :::no-loc text=interface::: (C# Reference) docs.microsoft.com - 인터페이스 - 구현해야할 멤버들을 선언하는 것 - 인터페이스 안에서 구현 불가 - 인터페이스 안에 쓸 수 있는 멤버는 총 4개 - Methods - Properties - Indexers // 인덱서를 공부한..
C# 주석에 대한 XML 태그
🟦 XML 태그 - summary 기능을 사용하면 메서드와 파라미터에 대한 설명이 뜨기 때문에 더욱 편리하다. 🟧 document https://docs.microsoft.com/ko-kr/dotnet/csharp/language-reference/xmldoc/ XML 문서 주석 - /// 주석을 사용하여 API 문서화 XML 문서 주석에 대해 알아봅니다. 특수 주석 필드에 XML 요소를 넣어 코드의 설명서를 만들 수 있습니다. 다른 도구를 사용하여 주석에서 문서 레이아웃을 빌드할 수 있습니다. docs.microsoft.com 🟧 Class - 슬래시( / ) 세번 입력 후 태그 입력 - 주석으로 입력할 부분 모두 슬래시 3번을 앞에 입력해줘야한다. - summary 태그 안에 클래스에 대한 설명을 작..
에러 : Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform.
🔷 에러메세지 패키지를 임포트하니 아래의 에러가 생겼다. 🔶 에러메세지 1 Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform. 🔶 에러메세지 2 PrecompiledAssemblyException: Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allo..