- Extension files should always begin with the type name and end with
Extensions. Examples:StringExtensions.csServiceCollectionExtensions.cs
- Write for every type a separate extension file.
- Use the origin namespace of the type; use
HotChocolatewhen extending an external type likeMicrosoft.Ectensions.DependencyInjection.IServiceCollectionorHotChocolate.AspNetCorewhen extending a ASP .Net core specific type likeMicrosoft.AspNetCore.Builder.IApplicationBuilder. Example:using Microsoft.Extensions.DependencyInjection; namespace HotChocolate { public static class ServiceCollectionExtensions { public static IServiceCollection AddGraphQL( this IServiceCollection serviceCollection, ISchema schema) { // omitted for brevity } } }