.NET Core API Reference

System.Collections.Generic

Contains interfaces and classes that define generic collections, which allow users to create and manage collections of objects that can be strongly typed.

List<T> Class

public class List<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable

Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.

Methods:
Add(T item)
Appends the given element to the end of the List.
Remove(T item)
Removes the first occurrence of a specific object from the List.
Insert(int index, T item)
Inserts an element into the List at the specified index.
Find(Predicate<T> match)
Searches the entire sorted List for an element using the default comparer and returns the zero-based index of the element.

Dictionary<TKey, TValue> Class

public class Dictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable

Represents a collection of keys and values that are paired together. Each key must be unique and cannot be null.

Methods:
Add(TKey key, TValue value)
Adds an element with the specified key and value to the dictionary.
ContainsKey(TKey key)
Determines whether the dictionary contains an element with the specified key.
TryGetValue(TKey key, out TValue value)
Gets the value associated with the specified key.

System.IO

Provides types that allow reading and writing files and data streams.

File Class

public static class File

Provides static methods for the creation, copying, deletion, moving, and opening of files.

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.
Exists(string path)
Determines whether a file exists.

System.Linq

Provides classes and interfaces that support language-integrated query (LINQ), which adds powerful query capabilities to .NET.

Extension Methods for IEnumerable<T>

LINQ provides numerous extension methods for collections implementing IEnumerable<T>.

Common Methods:
Where(Func<T, bool> predicate)
Filters a sequence of values based on a predicate.
Select<TResult>(Func<T, TResult> selector)
Projects each element of a sequence into a new form.
OrderBy<TKey>(Func<T, TKey> keySelector)
Sorts the elements of a sequence in ascending order.
FirstOrDefault()
Returns the first element of a sequence, or a default value if the sequence contains no elements.

System.Threading

Supports the creation and management of threads.

Task Class

public class Task : System.IAsyncResult

Represents an asynchronous operation.

Methods:
Run(Action action)
Executes the specified action asynchronously.
Delay(int millisecondsDelay)
Creates a task that completes after a specified time interval.

Microsoft.Extensions.DependencyInjection

Provides types for configuring and managing the service container.

IServiceCollection Interface

public interface IServiceCollection : ICollection<ServiceDescriptor>

Represents a collection of service descriptors that define how services are provided.

Methods:
AddSingleton<TService>()
Adds a singleton service of the specified type to the collection.
AddScoped<TService>()
Adds a scoped service of the specified type to the collection.
AddTransient<TService>()
Adds a transient service of the specified type to the collection.

Microsoft.EntityFrameworkCore

Provides the core types for Entity Framework Core.

DbContext Class

public abstract class DbContext

A combination of the Unit Of Work and Repository patterns that provides a way to use a model to manage database operations.

Properties:
DbSet<TEntity> Set<TEntity>()
Gets a DbSet<TEntity> that can be used to access database operations for the given entity type. This method can only be called from a derived context.
Methods:
SaveChanges()
Saves all changes made in this context to the underlying database.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

DbSet<TEntity> Class

public abstract class DbSet<TEntity> : IQueryable<TEntity>, IEnumerable<TEntity>, IQueryable, IEnumerable

Represents a set of entities in the context.

Methods:
Add(TEntity entity)
Adds the given entity to the context.
Remove(TEntity entity)
Marks the given entity as deleted from the context.
Update(TEntity entity)
Marks the given entity as modified in the context.