Is it possible to have "inherited partial structs" in c#?

Posted by Balazs on Stack Overflow See other posts from Stack Overflow or by Balazs
Published on 2010-05-07T16:14:23Z Indexed on 2010/05/07 16:18 UTC
Read the original article Hit count: 348

Filed under:
|

Is it possible to use partial structs to achieve something like this: Have an asp.net page base class with the following defined:

public partial struct QuerystringKeys
{
    public const string Username = "username";
    public const string CurrentUser = "currentUser";
}

Have an asp.net page, which inherits from the base class mentioned above, extend the partial declaration:

public partial struct QuerystringKeys
{
    /// <summary>
    /// The page number of the review instances list
    /// </summary>
    public const string Page = "page";
}

The final goal is a QuerystringKeys struct with all three constant strings defined in it available to the asp.net page.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#