System
Provides fundamental classes and base types that define value types, references types, generic type parameters, methods, and attributes used throughout the .NET Framework.
System.String
Represents text as a sequence of characters.
Summary
The String class is a fundamental type in .NET for working with text data. It is an immutable sequence of characters.
Properties
Length: Gets the number of characters in the current String object.
Methods
Equals(string a, string b): Compares two strings for equality.
IsNullOrEmpty(string value): Indicates whether the specified string is null or an empty string.
Contains(char value): Determines whether an specified character occurs within this string.
public static bool Equals(string a, string b);
public static bool IsNullOrEmpty(string value);
public bool Contains(char value);
System.Int32
Represents a 32-bit signed integer.
Summary
The Int32 structure represents a 32-bit signed integer, which is a 32-bit integer type that ranges in value from -2,147,483,648 to 2,147,483,647.
Methods
Parse(string s): Converts the string representation of a number to its 32-bit signed integer equivalent.
ToString(): Converts the numeric value of this instance to its equivalent string representation.
public static int Parse(string s);
public override string ToString();
System.Console
Provides standard input, output, and error streams for console applications.
Summary
The Console class provides methods for interacting with the standard input, output, and error streams of the operating system's console.
Methods
WriteLine(string value): Writes the specified value to the standard output stream.
ReadLine(): Reads the next line of characters from the standard input stream and returns it as a string.
public static void WriteLine(string value);
public static string ReadLine();
System.Collections
Contains interfaces and classes that define generic collections of objects. These include lists, queues, stacks, and dictionaries.
System.Collections.Generic.List<T>
Represents a strongly typed list of objects that can be accessed by index. Provides methods for creating, searching and manipulating lists.
Summary
The List<T> generic collection is a dynamic array that provides performance of adding and removing items at the end of the collection, and offers performance of searching for an item in the collection.
Methods
Add(T item): Adds an object to the end of the List<T>.
Remove(T item): Removes the first occurrence of a specific object from the List<T>.
Count: Gets the number of elements actually contained in the List<T>.
public void Add(T item);
public bool Remove(T item);
System.IO
Provides types that allow reading and writing to files and data streams, and includes types that support basic file and directory operations.
System.IO.File
Provides static methods for the creation, copying, deletion, moving, and opening of files, and aids in their creation of Stream objects.
Summary
The File class provides methods for working with files. It offers static methods for common file operations.
Methods
ReadAllText(string path): Opens a text file, reads all lines of the file, and then closes the file.
WriteAllText(string path, string contents): Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.
public static string ReadAllText(string path);
public static void WriteAllText(string path, string contents);
System.Linq
Provides classes and interfaces that support Language Integrated Query (LINQ), which provides the ability to write queries against collections and other data sources in a declarative way.
System.Linq.Enumerable
Provides a set of static methods for querying collections that implement IEnumerable<T>.
Summary
The Enumerable class is the entry point for LINQ queries. It defines extension methods that operate on any data source that implements IEnumerable<T>.
Methods
Where<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate): Filters a sequence of values based on a predicate.
Select<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector): Projects each element of a sequence into a new form.
public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate);
public static IEnumerable<TResult> Select<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector);
System.Net
Provides a flexible programming model for network applications. This namespace contains types for networking operations such as TCP, UDP, and HTTP.
System.Net.Http.HttpClient
Sends HTTP requests and receives HTTP responses from a resource identified by a URI.
Summary
The HttpClient class is the primary class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI. It is recommended to instantiate one instance of HttpClient and reuse it throughout the life of an application.
Methods
GetAsync(string requestUri): Send an HTTP GET request to the specified URI as an asynchronous operation.
PostAsync(string requestUri, HttpContent content): Send an HTTP POST request to the specified URI as an asynchronous operation.
public async Task<HttpResponseMessage> GetAsync(string requestUri);
public async Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content);
System.Text
Provides classes for representing character encodings, abstracting the conversion between character encodings and the byte representations of characters.
System.Text.StringBuilder
Represents a mutable sequence of characters.
Summary
The StringBuilder class is used to create strings. It is more efficient than the String class when you need to concatenate a large number of strings. The String class is immutable, meaning that each concatenation creates a new string object.
Methods
Append(string value): Appends the string representation of the specified value to this instance.
ToString(): Converts this instance to a string.
public StringBuilder Append(string value);
public override string ToString();
System.Threading
Contains types that represent and manage threads and related activities, such as thread synchronization primitives.
System.Threading.Tasks.Task
Represents an asynchronous operation.
Summary
The Task class is used to represent an asynchronous operation. It provides a way to manage the execution of asynchronous code, including awaiting its completion and handling its results or exceptions.
Methods
Run(Action action): Executes a given Action delegate asynchronously using the default task scheduler and returns a task that represents the asynchronous operation.
WhenAll(params Task[] tasks): Creates a task that completes when all of the supplied tasks have completed.
public static Task Run(Action action);
public static Task WhenAll(params Task[] tasks);
Microsoft.Extensions.DependencyInjection
Provides types for enabling the use of dependency injection in an application.
Microsoft.Extensions.DependencyInjection.ServiceCollection
A collection of service descriptors.
Summary
The ServiceCollection class represents a collection of service descriptors. It's used to define services and their lifetimes before building an IServiceProvider.
Methods
AddTransient<TService>(): Adds a transient service of the specified type to the collection.
AddSingleton<TService>(): Adds a singleton service of the specified type to the collection.
public IServiceCollection AddTransient<TService>() where TService : class;
public IServiceCollection AddSingleton<TService>() where TService : class;
Microsoft.AspNetCore.Mvc
Provides types for building web applications using the Model-View-Controller (MVC) pattern.
Microsoft.AspNetCore.Mvc.ControllerBase
Base class for MVC controllers that do not support view rendering.
Summary
ControllerBase is a base class for controllers that do not render views. It provides common functionality for handling HTTP requests and responses in API scenarios.
Properties
ControllerContext: Gets or sets the controller's context information.
Request: Gets the context's HttpRequest.
Response: Gets the context's HttpResponse.
Methods
Ok(object value): Returns an OkResult that produces an HttpResponseMessage with a 200 status code.
NotFound(): Returns a NotFoundResult that produces an HttpResponseMessage with a 404 status code.
public virtual OkObjectResult Ok(object value);
public virtual NotFoundResult NotFound();