.NET Core API Reference

Explore the core libraries and frameworks for .NET Core development.

Introduction to .NET Core APIs

.NET Core provides a rich set of APIs to build modern, cross-platform applications. This reference documentation covers the fundamental namespaces and classes available.

The .NET Core API is organized into namespaces, which group related types (classes, structs, interfaces, enums, etc.). Understanding these namespaces is key to effectively using the framework.

Key Namespaces

The following are some of the most commonly used namespaces:

Discovering APIs

You can navigate through the API reference using the sidebar or by using the search functionality above.

Each API documentation page typically includes:

Common API Patterns

Asynchronous Programming

.NET Core heavily leverages asynchronous programming patterns using async and await keywords, built upon the Task and Task<TResult> types found in System.Threading.Tasks.


// Example of an asynchronous method
public async Task<string> DownloadDataAsync(string url)
{
    using (var httpClient = new HttpClient())
    {
        string content = await httpClient.GetStringAsync(url);
        return content;
    }
}
            

Dependency Injection

Built-in support for Dependency Injection (DI) is a cornerstone of .NET Core, managed via the Microsoft.Extensions.DependencyInjection namespace. It allows for flexible and testable application design.

Configuration

Configuration management is handled through the Microsoft.Extensions.Configuration namespace, supporting various sources like JSON files, environment variables, and command-line arguments.

Getting Started with API Exploration

To get the most out of the .NET Core API reference:

  1. Identify your needs: Determine what functionality you need (e.g., file operations, web requests, data structures).
  2. Navigate to the relevant namespace: Use the sidebar or search to find the namespace that likely contains the types you need.
  3. Explore types and members: Within a namespace, look for classes or interfaces that match your requirements. Examine their members for the specific methods or properties.
  4. Review examples: Code examples are crucial for understanding how to use APIs correctly.

Happy coding!