提交 5b356c72 编写于 作者: S Shay Rojansky

Correct naming & docs for AddEntityFrameworkNpgsql

See https://github.com/MiniProfiler/dotnet/issues/433#issuecomment-558328803
上级 d6a2690f
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.Query.Internal;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Microsoft.EntityFrameworkCore.Update;
......@@ -31,36 +31,24 @@ namespace Microsoft.Extensions.DependencyInjection
/// Provides extension methods to configure Entity Framework Core for Npgsql.
/// </summary>
// ReSharper disable once UnusedMember.Global
public static class NpgsqlEntityFrameworkServicesBuilderExtensions
public static class NpgsqlServiceCollectionExtensions
{
/// <summary>
/// <para>
/// Adds the services required by the Npgsql database provider for Entity Framework
/// to an <see cref="IServiceCollection" />. You use this method when using dependency injection
/// in your application, such as with ASP.NET. For more information on setting up dependency
/// injection, see http://go.microsoft.com/fwlink/?LinkId=526890.
/// to an <see cref="IServiceCollection" />.
/// </para>
/// <para>
/// You only need to use this functionality when you want Entity Framework to resolve the services it uses
/// from an external <see cref="IServiceCollection" />. If you are not using an external
/// <see cref="IServiceCollection" /> Entity Framework will take care of creating the services it requires.
/// Calling this method is no longer necessary when building most applications, including those that
/// use dependency injection in ASP.NET or elsewhere.
/// It is only needed when building the internal service provider for use with
/// the <see cref="DbContextOptionsBuilder.UseInternalServiceProvider" /> method.
/// This is not recommend other than for some advanced scenarios.
/// </para>
/// </summary>
/// <example>
/// <code>
/// public void ConfigureServices(IServiceCollection services)
/// {
/// var connectionString = "connection string to database";
///
/// services
/// .AddEntityFrameworkSqlServer()
/// .AddDbContext&lt;MyContext&gt;(options => options.UseNpgsql(connectionString));
/// }
/// </code>
/// </example>
/// <param name="serviceCollection"> The <see cref="IServiceCollection" /> to add services to. </param>
/// <returns>
/// A builder that allows further Entity Framework specific setup of the <see cref="IServiceCollection" />.
/// The same service collection so that multiple calls can be chained.
/// </returns>
public static IServiceCollection AddEntityFrameworkNpgsql([NotNull] this IServiceCollection serviceCollection)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册