csharp 关键字分”全局”关键字和上下文关键字。上下文关键字只在特定的程序块中才生效, 一般情况下可以作为标识符。在关键字前面加@
符号,则可以作为标识符使用
全局关键字
abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual void volatile while
上下文关键字
add and alias ascending args async await by descending dynamic equals from get global group init into join let 托管(函数指针调用约定) nameof nint not notnull nuint on or orderby partial(类型) partial(方法) record remove selectset 非托管(函数指针调用约定) unmanaged(泛型类型约束) value var when(筛选条件) where(泛型类型约束) where(查询子句) with yield