© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
3 replies
Hotz

[SOLVED] What is happening in this snippet?

My guess is: since
AppDbContext
AppDbContext
inherits from
DbContext
DbContext
, it also inherits the ctor and all the parameters that the ctor takes. This way,
AppDbContext
AppDbContext
's ctor is being overwritten so that it only has the
options
options
parameter from its parent class. Is this correct?

public class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
    {
        
    }
}
public class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
    {
        
    }
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

what is this code snippet doing?
C#CC# / help
4y ago