EntityFramework.Docs icon indicating copy to clipboard operation
EntityFramework.Docs copied to clipboard

Add a constructor for testing example does not mentiond "TContext"

Open RyanTaite opened this issue 8 years ago • 1 comments

The example given:

public class BloggingContext : DbContext
{
    public BloggingContext()
    { }

    public BloggingContext(DbContextOptions<BloggingContext> options)
        : base(options)
    { }

Does not line up with the text following it:

DbContextOptions<TContext> tells the context all of its settings, such as which database to connect to. This is the same object that is built by running the OnConfiguring method in your context.

Since TContext is not mentioned in the example code


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

RyanTaite avatar Aug 22 '18 19:08 RyanTaite

I misunderstood the syntax. <TContext> is a DbContextOptions parameter that BloggingContext satisfies.

My mistake. Closing this.

RyanTaite avatar Aug 22 '18 21:08 RyanTaite