/C-Sharp-cheatsheet

This is code, notes, and snippets about C#

Primary LanguageC#

C#

My learning note & material for C#

What is C#?

C# is object oriented language created by Microsoft.

Note: OOP focus on Object and Class, there should be object reference for access non static members, methods or properties. 需要有物件參考,才可使用非靜態欄位、方法或屬性. For static, no object reference required.

C# OOP has four basic concepts, Abstraction, Encapsulation, Inheritance, Polymorphism

What does C# use for?

  • Desktop software (Window application)
  • Video Games (Unity)
  • Web application

.NET

Application Framework. .NET is an open source developer platform for building desktop, web, and mobile applications and many different types of applications that can run natively on any operating system. With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, IoT, and more. The .NET system includes tools, libraries, and languages that support modern, scalable, and high-performance software development.

https://dotnet.microsoft.com/zh-cn/
https://aws.amazon.com/what-is/net/?nc1=h_ls

https://learn.microsoft.com/zh-tw/dotnet/core/introduction

.NET sdk

https://github.com/dotnet/sdk
https://dotnet.microsoft.com/en-us/download

.NET doc

https://learn.microsoft.com/en-us/dotnet/
https://learn.microsoft.com/zh-tw/dotnet/fundamentals/

.NET API Reference

https://learn.microsoft.com/en-us/dotnet/api/?view=net-7.0

tutorial - 4 hour

https://youtu.be/wxznTygnRfQ

https://www.youtube.com/watch?v=T9BeejD3i0g

Documentation comments (XML format) for C# (similar to Javadoc and JDoc)

C# provides a mechanism for programmers to document their code using a comment syntax that contains XML text. In source code files, comments having a certain form can be used to direct a tool to produce XML from those comments and the source code elements, which they precede. Comments using such syntax are called documentation comments.

C# source files can have structured comments that produce API documentation for the types defined in those files.

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/documentation-comments

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/

Recommended tags

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/recommended-tags

Examples

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/examples

project file

https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/web-deployment-in-the-enterprise/understanding-the-project-file

Best IDE for C#

  • Visual studio
  • VSCode

How to format C# code in VSCode

Select the code > right click > Format selection

or Ctrl + K Ctrl + F

C# compiler

Mono : https://www.mono-project.com/

https://dotnetfiddle.net/

https://www.programiz.com/csharp-programming/online-compiler/

ref

https://learn.microsoft.com/en-us/dotnet/csharp/

https://www.programiz.com/csharp-programming

https://www.javatpoint.com/c-sharp-tutorial

https://www.tutorialspoint.com/csharp/index.htm

https://www.tutorialsteacher.com/csharp

https://www.youtube.com/watch?v=gfkTfcpWqAY

https://youtu.be/GhQdlIFylQ8

https://www.youtube.com/watch?v=GhQdlIFylQ8

https://www.csharptutorial.net/