목차
C# concepts
How-to C# articles
The .NET Compiler Platform SDK(Roslyn APIs)
C# programming guide
Language reference
Overview
Configure language version
Types
Value types(값 형식)
Reference types
void
var
Built-in types
Unmanaged types
Default value
Keywords
Overview
Modifiers
Statement Keywords
Method Parameters
Namespace Keywords
Type-testing Keywords
Generic Type Constraint Keywords
Access Keywords
Literal Keywords
Contextual Keywords
Query Keywords
Operators and expressions
Overview
Arithmetic operators
Boolean logical operators
Bitwise and shift operators
Equality operators
Comparison operators
Member access operator and expressions
Type-testing operators and cast expressions
User-defined conversion operators
Assignment operators
Lambda expressions
+ and += operators
- and -= operators
?: operators
!(null-forgiving) operator
?? and ??= operators
=> operators
:: operator
await operator
default value expressions
delegate operator
nameof expression
new operator
sizeof operator
stackalloc expression
switch expression
true and false operators
with expression
Operator overloading
Special characters
Attributes read by the compiler
Preprocessor directives
Compiler options
Compiler errors
C# 6.0 draft specification
C# 7.0-9.0 proposals
단순 형식
열거형 형식
구조체 형식
Nullable 값 형식
null을 허용하지 않는 형식을 T라고 한다면, 이에 대응되는 nullalbe형식 T?가 있다. string?은 string 또는 null값을 보유할 수 있는 형식이다.
튜블 값 형식
참조 형식
클래스 형식
string(UTF-16)
인터페이스 형식
배열 형식
대리자 형식(delegate)
delegate는 대표(자), 위임하다는 의미를 가지고 있다.
메서드에 대한 참조를 나타내는 형식이다. 함수 포인터와 달리 delegate는 객체지향적이며 형식이 안전하다.
System.Action 및 System.Func 는 대리자의 일반적인 정의를 제공한다. 대지라는 함수포인터와 유사하여 이벤트의 기반이 된다. 대리자는 메서드(명명된 것)나 무명 메서드와 연결하여 인스턴스화할 수 있다.
대리자는 메서드나 람다식을 사용하여 인스턴스화해야 한다.
한정자
internal
동일한 어셈블리의 파일 내에서만 액세스할 수 있습니다.
콜렉션
가변크기 컨테이너, Vector, ArrayList, LinkedList, HashSet, Stack, HashMap<key, value>
IEnumerable
foreach, 임의접근이 가능, 내부적으로 Enumerator를 가지고 있다.
IEnumerator
순차접근 가능(MoveNext()), 접근위치를 내부적으로 가지고 있다.
LINQ(Language Integrated Query)
var value = from 익명변수명 in ~
where ...
select 추출할_항목;