© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
25 replies
Alex

Static property override

I have a base class
BaseOptions
BaseOptions
and it has name value, that I will override in each child class.
Base Class
public (class/interface) BaseOptions
{
  string Name
}
public (class/interface) BaseOptions
{
  string Name
}

Child Class
public class ApplicationOptions:BaseOptions
{
    public required string ClientBaseUrl { get; set; }
    // override string Name
}
public class ApplicationOptions:BaseOptions
{
    public required string ClientBaseUrl { get; set; }
    // override string Name
}

Usage
builder.Services.Configure<ApplicationOptions>(builder.Configuration.GetSection(ApplicationOptions.Name));
builder.Services.Configure<ApplicationOptions>(builder.Configuration.GetSection(ApplicationOptions.Name));

What should I use to create structure like above?
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

Static property issues
C#CC# / help
2y ago
❔ can a static class contain static class as property
C#CC# / help
3y ago
✅ Override (abstract) getter-only property with a setter
C#CC# / help
3y ago
❔ Changing TextBlock Background property in a static method
C#CC# / help
4y ago